From: Russell Bryant Date: Thu, 20 Dec 2007 20:21:41 +0000 (+0000) Subject: Fix another potential seg fault ... X-Git-Tag: 1.2.26.1~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4208af22044445bd5f919ba9f4476812ffde37bf;p=thirdparty%2Fasterisk.git Fix another potential seg fault ... (closes issue #11606) Reported by: dimas git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@94255 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index e4d8267988..820f474bd2 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -2620,7 +2620,7 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in *sin) { - struct ast_variable *var; + struct ast_variable *var = NULL; struct ast_variable *tmp; struct iax2_peer *peer=NULL; time_t regseconds, nowtime; @@ -2654,7 +2654,7 @@ static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in * is because we only have the IP address and the host field might be * set as a name (and the reverse PTR might not match). */ - if (var) { + if (var && sin) { for (tmp = var; tmp; tmp = tmp->next) { if (!strcasecmp(tmp->name, "host")) { struct in_addr sin2 = { 0, };