]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_iax2.c: Avoid crash with IAX2 switch support.
authorSean Bright <sean@seanbright.com>
Fri, 7 Jul 2023 19:57:39 +0000 (15:57 -0400)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Wed, 12 Jul 2023 17:40:07 +0000 (17:40 +0000)
A change made in 82cebaa0 did not properly handle the case when a
channel was not provided, triggering a crash. ast_check_hangup(...)
does not protect against NULL pointers.

Fixes #180

channels/chan_iax2.c

index 5b3caf03b540d9c9c301ee23534b5843816e8ebe..3f8e5c1d328259c21592c2b3e48db0833e8085ca 100644 (file)
@@ -14323,7 +14323,7 @@ static struct iax2_dpcache *find_cache(struct ast_channel *chan, const char *dat
                        ast_log(LOG_WARNING, "Timeout waiting for %s exten %s\n", data, exten);
                }
 
-               if (ast_check_hangup(chan)) {
+               if (chan && ast_check_hangup(chan)) {
                        doabort = 1;
                }