[gupnp] service-action: Protect against unsent message use
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] service-action: Protect against unsent message use
- Date: Thu, 20 May 2021 10:57:08 +0000 (UTC)
commit 8a349541f10b774ac8128bfb0e25ddbb405e6033
Author: Jens Georg <mail jensge org>
Date: Wed May 19 19:40:41 2021 +0200
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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]