From cf02e4b0d7d9ceba7bc1c5a599164a6ce95448db Mon Sep 17 00:00:00 2001 From: linker99 Date: Tue, 31 Oct 2023 04:03:04 +0800 Subject: [PATCH] service-action: Do not leak message if never sent --- gupnp.spec | 6 ++- ...on-Do-not-leak-message-if-never-sent.patch | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 service-action-Do-not-leak-message-if-never-sent.patch diff --git a/gupnp.spec b/gupnp.spec index b880715..4aba16f 100644 --- a/gupnp.spec +++ b/gupnp.spec @@ -1,6 +1,6 @@ Name: gupnp Version: 1.2.4 -Release: 4 +Release: 5 Summary: UPnP devices & control points creation framework License: LGPLv2+ URL: http://www.gupnp.org/ @@ -9,6 +9,7 @@ Patch0: CVE-2021-33516.patch Patch1: ServiceProxy-Remove-bogos-function-rename.patch Patch2: linux-cm-Fds-can-be-0.patch Patch3: service-action-Protect-against-unsent-message-use.patch +Patch4: service-action-Do-not-leak-message-if-never-sent.patch BuildRequires: gssdp-devel >= 1.2.3 gtk-doc gobject-introspection-devel >= 1.36 BuildRequires: libsoup-devel libxml2-devel libuuid-devel vala meson @@ -77,6 +78,9 @@ This package contains help file and developer documentation for gupnp. %{_mandir}/man1/gupnp-binding-tool-* %changelog +* Thu Nov 9 2023 fandehui - 1.2.4-5 +- service-action: Do not leak message if never sent + * Fri Nov 3 2023 fandehui - 1.2.4-4 - service-action: Protect against unsent message use - If the action wasn't sent, do not crash diff --git a/service-action-Do-not-leak-message-if-never-sent.patch b/service-action-Do-not-leak-message-if-never-sent.patch new file mode 100644 index 0000000..a1e325e --- /dev/null +++ b/service-action-Do-not-leak-message-if-never-sent.patch @@ -0,0 +1,40 @@ +From 0f59d903c9db01f7cbe6c2ebede0a570dd29f0f5 Mon Sep 17 00:00:00 2001 +From: Jens Georg +Date: Wed, 19 May 2021 19:42:59 +0200 +Subject: [PATCH] service-action: Do not leak message if never sent + +--- + libgupnp/gupnp-service-proxy-action.c | 4 ++++ + libgupnp/gupnp-service-proxy.c | 1 + + 2 files changed, 5 insertions(+) + +diff --git a/libgupnp/gupnp-service-proxy-action.c b/libgupnp/gupnp-service-proxy-action.c +index 2fd10d5..da41d91 100644 +--- a/libgupnp/gupnp-service-proxy-action.c ++++ b/libgupnp/gupnp-service-proxy-action.c +@@ -230,6 +230,10 @@ action_dispose (GUPnPServiceProxyAction *action) + g_clear_object (&action->cancellable); + g_clear_error (&action->error); + g_clear_object (&action->msg); ++ if (action->msg_str != NULL) { ++ g_string_free (action->msg_str, TRUE); ++ action->msg_str = NULL; ++ } + g_free (action->name); + } + +diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c +index cec7c8a..0201638 100644 +--- a/libgupnp/gupnp-service-proxy.c ++++ b/libgupnp/gupnp-service-proxy.c +@@ -724,6 +724,7 @@ prepare_action_msg (GUPnPServiceProxy *proxy, + ret->msg_str->len); + + g_string_free (ret->msg_str, FALSE); ++ ret->msg_str = NULL; + } + + static void +-- +2.27.0 +