Skip to content
Snippets Groups Projects
  • Matt Jordan's avatar
    9c293b51
    main/dial: Protect access to the format_cap structure of the requesting channel · 9c293b51
    Matt Jordan authored
    When a dial attempt is made that involves a requesting channel, we previously
    were not:
    a) Protecting access to the native format capabilities structure on the
       requesting channel. That is inherently unsafe.
    b) Reference bumping the lifetime of the format capabilities structure.
    
    In both cases, something else could sneak in, blow away the format
    capabilities, and we'd be holding onto an invalid format_cap structure. When
    the newly created channel attempts to construct its format capabilities, things
    go poorly.
    
    This patch:
    a) Ensures that we get a reference to the native format capabilities while
       the requesting channel is locked
    b) Holds a reference to the native format capabilities during the creation
       of the new channel.
    
    ASTERISK-25522 #close
    
    Change-Id: I0bfb7ba8b9711f4158cbeaae96edf9626e88a54f
    9c293b51
    History
    main/dial: Protect access to the format_cap structure of the requesting channel
    Matt Jordan authored
    When a dial attempt is made that involves a requesting channel, we previously
    were not:
    a) Protecting access to the native format capabilities structure on the
       requesting channel. That is inherently unsafe.
    b) Reference bumping the lifetime of the format capabilities structure.
    
    In both cases, something else could sneak in, blow away the format
    capabilities, and we'd be holding onto an invalid format_cap structure. When
    the newly created channel attempts to construct its format capabilities, things
    go poorly.
    
    This patch:
    a) Ensures that we get a reference to the native format capabilities while
       the requesting channel is locked
    b) Holds a reference to the native format capabilities during the creation
       of the new channel.
    
    ASTERISK-25522 #close
    
    Change-Id: I0bfb7ba8b9711f4158cbeaae96edf9626e88a54f