From: Russell Bryant Date: Sat, 19 Sep 2009 02:51:13 +0000 (+0000) Subject: Make sure the iax_pvt exists before dereferencing it. X-Git-Tag: 1.4.27-rc2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e24571defdca835eaa140e9e9157422d25e6c94;p=thirdparty%2Fasterisk.git Make sure the iax_pvt exists before dereferencing it. This fixes the latest crash posted on issue 15609. (issue #15609) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@219586 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index caf39cb1b5..eb482bcdec 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8423,7 +8423,7 @@ static int socket_process(struct iax2_thread *thread) * this connection yet. */ if ((dcallno != 1) && (fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, NEW_PREVENT, fd, 1))) { ast_mutex_lock(&iaxsl[fr->callno]); - if (ast_test_flag(iaxs[fr->callno], IAX_ENCRYPTED)) { + if (iaxs[fr->callno] && ast_test_flag(iaxs[fr->callno], IAX_ENCRYPTED)) { if (decrypt_frame(fr->callno, fh, &f, &res)) { ast_log(LOG_NOTICE, "Packet Decrypt Failed!\n"); ast_mutex_unlock(&iaxsl[fr->callno]);