From: Joshua Colp Date: Mon, 1 Oct 2007 15:57:04 +0000 (+0000) Subject: Check to make sure a structure pointer is non-NULL before touching it... crashing... X-Git-Tag: 1.6.0-beta1~3^2~1287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ae00a58b341686d4913f5458dacf07fe83ad808;p=thirdparty%2Fasterisk.git Check to make sure a structure pointer is non-NULL before touching it... crashing is bad, mmmk? (closes issue #10831) Reported by: eliel Patches: chan_sip.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84176 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c671b62bd2..2bd516b8d7 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -18912,7 +18912,7 @@ static char *sip_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a ast_verbose("Previous SIP reload not yet done\n"); else { sip_reloading = TRUE; - sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD; + sip_reloadreason = (a && a->fd) ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD; } ast_mutex_unlock(&sip_reload_lock); restart_monitor();