asterisk: add upstream patch against iax2 crash 824/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Sun, 23 Jul 2023 13:58:44 +0000 (15:58 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sun, 23 Jul 2023 13:58:50 +0000 (15:58 +0200)
Reported by Sergio in issue #821. This adds upstream patch for the
crash. See upstream issue [1] for details.

[1] https://github.com/asterisk/asterisk/issues/180

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk/Makefile
net/asterisk/patches/180-chan_iax2.c-Avoid-crash-with-IAX2-switch-support.patch [new file with mode: 0644]

index f6e35d384450996392980f5315869a2e577c157d..d670e8b6e6514bf13937b1ad43d893bc53b73159 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk
 PKG_VERSION:=18.15.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
diff --git a/net/asterisk/patches/180-chan_iax2.c-Avoid-crash-with-IAX2-switch-support.patch b/net/asterisk/patches/180-chan_iax2.c-Avoid-crash-with-IAX2-switch-support.patch
new file mode 100644 (file)
index 0000000..52a4dd5
--- /dev/null
@@ -0,0 +1,25 @@
+From 39912b91384b4a6a4b4b34cdd338970c184fb096 Mon Sep 17 00:00:00 2001
+From: Sean Bright <sean@seanbright.com>
+Date: Fri, 7 Jul 2023 15:57:39 -0400
+Subject: [PATCH] chan_iax2.c: Avoid crash with IAX2 switch support.
+
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/channels/chan_iax2.c
++++ b/channels/chan_iax2.c
+@@ -14312,7 +14312,7 @@ static struct iax2_dpcache *find_cache(s
+                       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;
+               }