Skip to content

Commit 7410c94

Browse files
authored
Merge pull request #77 from restreamio/fix/libnice-tcp-ice-candidate-crash
Fix: libnice TCP ICE candidate crash
2 parents ae2a68d + 8a2d41d commit 7410c94

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

docker/build-gstreamer/compile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ git apply /compile-patch/0001-pad-Check-data-NULL-ness-when-probes-are-stopped-f
3131
git apply /compile-patch/0001-Reduce-logs-verbosity-in-webrtcbin-when-a-FEC-decode.patch
3232
git apply /compile-patch/0001-glvideomixer-update-API-to-be-compatible-with-versio.patch
3333
git apply /compile-patch/0001-GstAudioAggregator-fix-structure-unref.patch
34+
git apply /compile-patch/0001-libnice.wrap-fix-incomplete-TCP-ICE-candidate-crash.patch
3435

3536
# This is needed for other plugins to be built properly
3637
ninja -C build install
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From 99c642e9de04964ac6ae3c9aa50b28b134ae8496 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Lo=C3=AFc=20Le=20Page?= <llepage@igalia.com>
3+
Date: Mon, 20 Oct 2025 14:17:38 +0200
4+
Subject: [PATCH] libnice.wrap: fix incomplete TCP ICE candidate crash
5+
6+
---
7+
subprojects/libnice.wrap | 1 +
8+
...sing-an-incomplete-TCP-ICE-candidate.patch | 30 +++++++++++++++++++
9+
2 files changed, 31 insertions(+)
10+
create mode 100644 subprojects/packagefiles/libnice-0.1.21/0001-agent-fix-parsing-an-incomplete-TCP-ICE-candidate.patch
11+
12+
diff --git a/subprojects/libnice.wrap b/subprojects/libnice.wrap
13+
index eeed32daa2..2dc672b27b 100644
14+
--- a/subprojects/libnice.wrap
15+
+++ b/subprojects/libnice.wrap
16+
@@ -2,3 +2,4 @@
17+
directory=libnice
18+
url=https://gitlab.freedesktop.org/libnice/libnice.git
19+
revision=0.1.21
20+
+diff_files = libnice-0.1.21/0001-agent-fix-parsing-an-incomplete-TCP-ICE-candidate.patch
21+
diff --git a/subprojects/packagefiles/libnice-0.1.21/0001-agent-fix-parsing-an-incomplete-TCP-ICE-candidate.patch b/subprojects/packagefiles/libnice-0.1.21/0001-agent-fix-parsing-an-incomplete-TCP-ICE-candidate.patch
22+
new file mode 100644
23+
index 0000000000..8dec6b9948
24+
--- /dev/null
25+
+++ b/subprojects/packagefiles/libnice-0.1.21/0001-agent-fix-parsing-an-incomplete-TCP-ICE-candidate.patch
26+
@@ -0,0 +1,30 @@
27+
+From d5f6db4100fedb01f62909ee342a8ccaa1274431 Mon Sep 17 00:00:00 2001
28+
+From: =?UTF-8?q?Lo=C3=AFc=20Le=20Page?= <llepage@igalia.com>
29+
+Date: Mon, 20 Oct 2025 13:31:54 +0200
30+
+Subject: [PATCH] agent: fix parsing an incomplete TCP ICE candidate
31+
+
32+
+If a TCP ICE candidate mline in a SDP doesn't specify the `tcptype`
33+
+field, it was crashing the agent because of the non-null assert in
34+
+`g_ascii_strcasecmp`. The patch is just ignoring an incomplete TCP
35+
+candidate just like the other malformed candidates.
36+
+---
37+
+ agent/agent.c | 3 +++
38+
+ 1 file changed, 3 insertions(+)
39+
+
40+
+diff --git a/agent/agent.c b/agent/agent.c
41+
+index 0d1f1814..7d22e22b 100644
42+
+--- a/agent/agent.c
43+
++++ b/agent/agent.c
44+
+@@ -7613,6 +7613,9 @@ nice_agent_parse_remote_candidate_sdp (NiceAgent *agent, guint stream_id,
45+
+ else if (g_ascii_strcasecmp (transport, "TCP-PASS") == 0)
46+
+ ctransport = NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE;
47+
+ else if (g_ascii_strcasecmp (transport, "TCP") == 0) {
48+
++ if (tcptype == NULL)
49+
++ goto done;
50+
++
51+
+ if (g_ascii_strcasecmp (tcptype, "so") == 0)
52+
+ ctransport = NICE_CANDIDATE_TRANSPORT_TCP_SO;
53+
+ else if (g_ascii_strcasecmp (tcptype, "active") == 0)
54+
+--
55+
+2.43.0
56+
+
57+
--
58+
2.43.0
59+

0 commit comments

Comments
 (0)