package/freeswitch: switch to pcre2

Added patch 0006 which replaces the usage of pcre in favour of pcre2,
this is a rebased version of upstream commits used by OpenWRT:
75acd1cdc2

Added patch 0005 which is a prerequisite for patch 0006, also used by
OpenWRT.

Added patch 0007 which fixes a runtime crash caused by patch 0006.

Added Upstream: tag to patch 0001.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Bernd Kuhls
2026-04-09 10:42:59 +02:00
committed by Julien Olivain
parent ef396fb9a0
commit 66b520817f
7 changed files with 1881 additions and 3 deletions

View File

@@ -353,7 +353,6 @@ package/freescale-imx/imx-uuc/S80imx-uuc Shellcheck lib_sysv.Indent lib_sysv.Var
package/freescale-imx/imx-vpu-hantro/0001-Fix-ion.h-header-inclusion-to-be-standard.patch lib_patch.Upstream
package/freescale-imx/imx-vpu-hantro/0002-Fix-build-with-uclibc-toolchain.patch lib_patch.Upstream
package/freescale-imx/imx-vpu-hantro/0003-Fix-Linux-kernel-version-header.patch lib_patch.Upstream
package/freeswitch/0001-libs-srtp-crypto-hash-hmac_ossl.c-fix-build-with-lib.patch lib_patch.Upstream
package/frr/S50frr Shellcheck
package/fstrcmp/0001-disable-rpath.patch lib_patch.Upstream
package/ftop/0001-overflow.patch lib_patch.Upstream

View File

@@ -25,6 +25,8 @@ crypto/hash/hmac_ossl.c:133:40: error: invalid application of 'sizeof' to incomp
Fixes:
- http://autobuild.buildroot.org/results/e696ead9ffffa5bb80928d75607bfbb9b263d3c6
Upstream: https://github.com/signalwire/freeswitch/pull/1654
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
libs/srtp/crypto/hash/hmac_ossl.c | 6 ++++--

View File

@@ -0,0 +1,34 @@
From 12b47fe7f91b93ba9cec90676e62c6239a097c98 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Fri, 3 Nov 2023 17:27:06 +0100
Subject: [PATCH] [mod_verto] Fix memory leak by correctly freeing regex
For mod_verto regex was never freed and was actually leaking memory.
Correctly free the compiled regex to fix the memory leak.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Upstream: https://github.com/signalwire/freeswitch/commit/12b47fe7f91b93ba9cec90676e62c6239a097c98
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/mod/endpoints/mod_verto/mod_verto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c
index 48c40527b56..36aba6db5e2 100644
--- a/src/mod/endpoints/mod_verto/mod_verto.c
+++ b/src/mod/endpoints/mod_verto/mod_verto.c
@@ -1893,10 +1893,12 @@ static void http_run(jsock_t *jsock)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"%d request [%s] matched expr [%s]\n", proceed, request->uri, expression);
request->uri = rule->value;
+ switch_regex_safe_free(re);
break;
}
rule = rule->next;
+ switch_regex_safe_free(re);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
From 02549c10d9155d0f71f36289aeeddc9c73a4d46e Mon Sep 17 00:00:00 2001
From: Andrey Volk <andywolk@gmail.com>
Date: Thu, 13 Nov 2025 17:42:04 +0300
Subject: [PATCH] [mod_dialplan_xml] Fix double free after upgrade to pcre2.
(#2946)
Upstream: https://github.com/signalwire/freeswitch/commit/02549c10d9155d0f71f36289aeeddc9c73a4d46e
[backported only second part of upstream commit, the first part is
already included in patch 0006]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
index 3d3fdfd8a93..cab522887c4 100644
--- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
+++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
@@ -357,6 +357,7 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *
save_proceed = proceed;
re = NULL;
+ match_data = NULL;
}
switch_regex_and_match_data_safe_free(re, match_data);

View File

@@ -10,7 +10,7 @@ config BR2_PACKAGE_FREESWITCH
select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
select BR2_PACKAGE_JPEG
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_PCRE
select BR2_PACKAGE_PCRE2
select BR2_PACKAGE_SOFIA_SIP
select BR2_PACKAGE_SPANDSP
select BR2_PACKAGE_SPEEX

View File

@@ -19,6 +19,9 @@ FREESWITCH_LICENSE_FILES = \
libs/apr/LICENSE \
libs/srtp/LICENSE
# 0006-Move-project-to-PCRE2.patch
FREESWITCH_AUTORECONF = YES
FREESWITCH_CPE_ID_VENDOR = freeswitch
# required dependencies
@@ -27,7 +30,7 @@ FREESWITCH_DEPENDENCIES = \
jpeg \
libcurl \
openssl \
pcre \
pcre2 \
spandsp \
sofia-sip \
speex \