]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure the iax_pvt exists before dereferencing it.
authorRussell Bryant <russell@russellbryant.com>
Sat, 19 Sep 2009 02:51:13 +0000 (02:51 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 19 Sep 2009 02:51:13 +0000 (02:51 +0000)
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

channels/chan_iax2.c

index caf39cb1b52887eb984e9035e7fc24f49c1d140e..eb482bcdec6cf1dc6d38c86145c813ee11a86ab8 100644 (file)
@@ -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]);