Skip to content
Snippets Groups Projects
  • Terry Wilson's avatar
    13427db6
    Fix segfault introduced by conversion to ACO API · 13427db6
    Terry Wilson authored
    The value "none" is specified in the config file as a valid value for
    the "video_mode" option. The code prior to the ACO conversion did not
    check for "none", but just ignored it and relied on the default zero
    value. The parsing with ACO is more strict, so without handling
    "none" specifically, parsing would fail.
    
    When parsing failed, but the module loaded anyway, the config info
    would never be stored, and one place in the code did not check for
    this case and would segfault. It was also possible that the
    aco_info struct's internals would be destroyed and used as well.
    
    This patch keeps the module from loading after parse failures, adds
    the "none" option to "video_mode", registers CLI functions only
    after parsing has completed, checks the config data for NULL before
    accessing it, and returns -1 on some allocation failures when
    initializing.
    
    
    (closes issue ASTERISK-20159)
    Reported by: Birger "WIMPy" Harzenetter
    Tested by: Birger "WIMPy" Harzenetter
    Patches:
        confbridge_fix3.txt uploaded by Terry Wilson
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    13427db6
    History
    Fix segfault introduced by conversion to ACO API
    Terry Wilson authored
    The value "none" is specified in the config file as a valid value for
    the "video_mode" option. The code prior to the ACO conversion did not
    check for "none", but just ignored it and relied on the default zero
    value. The parsing with ACO is more strict, so without handling
    "none" specifically, parsing would fail.
    
    When parsing failed, but the module loaded anyway, the config info
    would never be stored, and one place in the code did not check for
    this case and would segfault. It was also possible that the
    aco_info struct's internals would be destroyed and used as well.
    
    This patch keeps the module from loading after parse failures, adds
    the "none" option to "video_mode", registers CLI functions only
    after parsing has completed, checks the config data for NULL before
    accessing it, and returns -1 on some allocation failures when
    initializing.
    
    
    (closes issue ASTERISK-20159)
    Reported by: Birger "WIMPy" Harzenetter
    Tested by: Birger "WIMPy" Harzenetter
    Patches:
        confbridge_fix3.txt uploaded by Terry Wilson
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370341 65c4cc65-6c06-0410-ace0-fbb531ad65f3