summaryrefslogtreecommitdiff
path: root/libgupnp
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-05-25 16:57:58 +0200
committerJens Georg <mail@jensge.org>2022-05-25 16:57:58 +0200
commitb2fbaebb433dcf903f532580ad7dad9f8675bf00 (patch)
tree168367be7b26b6cccfa0052ff96aa73034804b68 /libgupnp
parent6d217227b9a0fa7836b1fa5639950af94c48617b (diff)
downloadgupnp-b2fbaebb433dcf903f532580ad7dad9f8675bf00.tar.gz
service: Prevent critical on notify error
The code did not handle the case nicelz where error wasn't "cancelled", using a NULL pointer from the reason phrase.
Diffstat (limited to 'libgupnp')
-rw-r--r--libgupnp/gupnp-service.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index 2c5f6ce..d515a87 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1428,10 +1428,17 @@ notify_got_response (GObject *source, GAsyncResult *res, gpointer user_data)
/* Emit 'notify-failed' signal */
GError *inner_error;
- inner_error = g_error_new_literal (
- GUPNP_EVENTING_ERROR,
- GUPNP_EVENTING_ERROR_NOTIFY_FAILED,
- soup_message_get_reason_phrase (data->msg));
+ // We have an error, so just propagate that
+ if (error != NULL) {
+ g_propagate_error (&inner_error,
+ g_steal_pointer (&error));
+ } else {
+ inner_error = g_error_new_literal (
+ GUPNP_EVENTING_ERROR,
+ GUPNP_EVENTING_ERROR_NOTIFY_FAILED,
+ soup_message_get_reason_phrase (
+ data->msg));
+ }
g_signal_emit (data->data->service,
signals[NOTIFY_FAILED],