diff --git a/libnice-0.1.14-fix-little-bugs-found-by-clang-analyzer.patch b/libnice-0.1.14-fix-little-bugs-found-by-clang-analyzer.patch new file mode 100644 index 0000000000000000000000000000000000000000..68c2483fe3e9e08d40e50018c9cbe0af62f21001 --- /dev/null +++ b/libnice-0.1.14-fix-little-bugs-found-by-clang-analyzer.patch @@ -0,0 +1,107 @@ +From bf77d08882bab00549642aeac903560fd76a4a98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= +Date: Thu, 27 Dec 2018 16:25:28 -0600 +Subject: [PATCH] Fix little bugs found by clang-analyzer + +--- + agent/agent.c | 2 ++ + agent/conncheck.c | 4 ++-- + stun/tests/test-format.c | 2 +- + stun/usages/bind.c | 2 ++ + tests/test-gstreamer.c | 5 ----- + 5 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/agent/agent.c b/agent/agent.c +index d7ba019..3c1cdcd 100644 +--- a/agent/agent.c ++++ b/agent/agent.c +@@ -5849,6 +5849,8 @@ nice_agent_set_software (NiceAgent *agent, const gchar *software) + if (software) + agent->software_attribute = g_strdup_printf ("%s/%s", + software, PACKAGE_STRING); ++ else ++ agent->software_attribute = NULL; + + nice_agent_reset_all_stun_agents (agent, TRUE); + +diff --git a/agent/conncheck.c b/agent/conncheck.c +index 2974415..66290b3 100644 +--- a/agent/conncheck.c ++++ b/agent/conncheck.c +@@ -3852,7 +3852,7 @@ static bool conncheck_stun_validater (StunAgent *agent, + ufrag = NULL; + if (cand->username) + ufrag = cand->username; +- else if (data->stream) ++ else + ufrag = data->stream->local_ufrag; + ufrag_len = ufrag? strlen (ufrag) : 0; + +@@ -3873,7 +3873,7 @@ static bool conncheck_stun_validater (StunAgent *agent, + + if (cand->password) + pass = cand->password; +- else if(data->stream->local_password[0]) ++ else if (data->stream && data->stream->local_password[0]) + pass = data->stream->local_password; + + if (pass) { +diff --git a/stun/tests/test-format.c b/stun/tests/test-format.c +index 735b073..0fd70e6 100644 +--- a/stun/tests/test-format.c ++++ b/stun/tests/test-format.c +@@ -251,7 +251,7 @@ int main (void) + if (stun_message_append_xor_addr (&msg, 0xffff, &addr.storage, + sizeof (addr)) != STUN_MESSAGE_RETURN_NOT_ENOUGH_SPACE) + fatal ("Address overflow test failed"); +- len = sizeof (msg); ++ + if (stun_agent_finish_message (&agent, &msg, NULL, 0) != 0) + fatal ("Fingerprint overflow test failed"); + if (stun_agent_finish_message (&agent, &msg, pwd, strlen ((char *) pwd)) != 0) +diff --git a/stun/usages/bind.c b/stun/usages/bind.c +index ee600a0..504bd89 100644 +--- a/stun/usages/bind.c ++++ b/stun/usages/bind.c +@@ -483,6 +483,8 @@ StunUsageBindReturn stun_usage_bind_run (const struct sockaddr *srv, + socklen_t alternate_server_len = sizeof (alternate_server); + StunUsageBindReturn bind_ret; + ++ trans.fd = -1; ++ + stun_agent_init (&agent, STUN_ALL_KNOWN_ATTRIBUTES, + STUN_COMPATIBILITY_RFC3489, 0); + +diff --git a/tests/test-gstreamer.c b/tests/test-gstreamer.c +index f060efc..2981c00 100644 +--- a/tests/test-gstreamer.c ++++ b/tests/test-gstreamer.c +@@ -105,7 +105,6 @@ create_buffer_list (void) + GstBufferList *list; + GstBuffer *rtp_buffer; + GstBuffer *data_buffer; +- gint total_size = 0; + + list = gst_buffer_list_new (); + +@@ -122,8 +121,6 @@ create_buffer_list (void) + /* Create a new group to hold the rtp header and the payload */ + gst_buffer_list_add (list, gst_buffer_append (rtp_buffer, data_buffer)); + +- total_size += gst_buffer_get_size (rtp_buffer); +- + /*** Second group, i.e. second packet. ***/ + + /* Create the RTP header buffer */ +@@ -137,8 +134,6 @@ create_buffer_list (void) + /* Create a new group to hold the rtp header and the payload */ + gst_buffer_list_add (list, gst_buffer_append (rtp_buffer, data_buffer)); + +- total_size += gst_buffer_get_size (rtp_buffer); +- + /* Calculate the size of the data */ + data_size = 2 * RTP_HEADER_SIZE + 2 * RTP_PAYLOAD_SIZE; + +-- +2.27.0 + diff --git a/libnice.spec b/libnice.spec index 2505696dcc19c0348fcaa5e6c6c0dbffc0a37409..15cf89af61ffe161f3106d53a56f9f41f3e2fab4 100644 --- a/libnice.spec +++ b/libnice.spec @@ -1,6 +1,6 @@ Name: libnice Version: 0.1.14 -Release: 10 +Release: 11 Summary: An implementation of ICE standard License: LGPLv2 and MPLv1.1 URL: https://nice.freedesktop.org/wiki/ @@ -9,6 +9,7 @@ Patch0001: libnice-0.1.14-85-g34d6044.patch Patch0002: libnice-0.1.14-tests-i686.patch Patch0003: libnice-0.1.14-tests-koji.patch Patch0004: libnice-0.1.14-turn-verify.patch +Patch0005: libnice-0.1.14-fix-little-bugs-found-by-clang-analyzer.patch BuildRequires: autoconf automake glib2-devel gnutls-devel >= 2.12.0 BuildRequires: gobject-introspection-devel gstreamer1-devel >= 0.11.91 @@ -77,6 +78,9 @@ make check %{_datadir}/{gtk-doc/html/libnice/,gir-1.0/Nice-0.1.gir} %changelog +* Wed Dec 27 2023 fandehui - 0.1.14-11 +- Fix little bugs found by clang-analyzer + * Wed Jan 15 2020 openEuler Buildteam - 0.1.14-10 - Type:enhancement - Id:NA