service-action: Protect against unsent message use

If the action wasn't sent, do not crash
This commit is contained in:
fandehui 2023-10-27 19:16:23 +08:00
parent adeb4b1b8f
commit 2890d6210f
2 changed files with 39 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: gupnp
Version: 1.2.4
Release: 3
Release: 4
Summary: UPnP devices & control points creation framework
License: LGPLv2+
URL: http://www.gupnp.org/
@ -8,6 +8,7 @@ Source0: http://download.gnome.org/sources/%{name}/1.2/%{name}-%{version}.
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
BuildRequires: gssdp-devel >= 1.2.3 gtk-doc gobject-introspection-devel >= 1.36
BuildRequires: libsoup-devel libxml2-devel libuuid-devel vala meson
@ -76,6 +77,10 @@ This package contains help file and developer documentation for gupnp.
%{_mandir}/man1/gupnp-binding-tool-*
%changelog
* Fri Nov 3 2023 fandehui <fandehui@xfusion.com> - 1.2.4-4
- service-action: Protect against unsent message use
- If the action wasn't sent, do not crash
* Thu Oct 26 2023 fandehui <fandehui@xfusion.com> - 1.2.4-3
- linux-cm: Fds can be 0

View File

@ -0,0 +1,33 @@
From 8a349541f10b774ac8128bfb0e25ddbb405e6033 Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Wed, 19 May 2021 19:40:41 +0200
Subject: [PATCH] service-action: Protect against unsent message use
If the action wasn't sent, do not crash
---
libgupnp/gupnp-service-proxy-action.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libgupnp/gupnp-service-proxy-action.c b/libgupnp/gupnp-service-proxy-action.c
index 3b3a7c1..2fd10d5 100644
--- a/libgupnp/gupnp-service-proxy-action.c
+++ b/libgupnp/gupnp-service-proxy-action.c
@@ -61,6 +61,15 @@ check_action_response (G_GNUC_UNUSED GUPnPServiceProxy *proxy,
xmlDoc *response;
int code;
+ if (action->msg == NULL) {
+ g_set_error (error,
+ GUPNP_SERVER_ERROR,
+ GUPNP_SERVER_ERROR_INVALID_RESPONSE,
+ "No message, the action was not sent?");
+
+ return NULL;
+ }
+
/* Check for errors */
switch (action->msg->status_code) {
case SOUP_STATUS_OK:
--
2.27.0