Check to make sure a structure pointer is non-NULL before touching it... crashing...
authorJoshua Colp <jcolp@digium.com>
Mon, 1 Oct 2007 15:57:04 +0000 (15:57 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 1 Oct 2007 15:57:04 +0000 (15:57 +0000)
(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

channels/chan_sip.c

index c671b62..2bd516b 100644 (file)
@@ -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();