• Stefan Knoblich's avatar
    [FreeTDM] Fix segfault in ftdm_analog_configure_span() on startup. · 02b29263
    Stefan Knoblich 提交于
    Using ftdm_log_chan() in ftdm_analog_configure_span() is a bad idea,
    since the span won't have any channels assigned.
    
    This bug powered by declaring all variables at the top of the function,
    even if they are used in an if branch at the end.
    
    A C99'ish:
    
    	if (callwaiting) {
    		for (unsigned int i = 1; i <= span->span->chan_count; i++) {
    			/* ... */
    		}
    	}
    
    would have alerted the developer adding the log statement.
    But since we can't have nice things (thanks MSVC for not supporting C99!)
    </rant>
    Signed-off-by: 's avatarStefan Knoblich <s.knoblich@axsentis.de>
    02b29263
ftmod_analog.c 40.3 KB