[librest/wip/baedert/gtask: 12/25] RestProxyCall: Prevent segfault in prepare_message



commit a5feedb99d7e89193e3f5ca3d86e6e90ca18bf83
Author: Timm Bäder <mail baedert org>
Date:   Fri Apr 22 16:13:42 2016 +0200

    RestProxyCall: Prevent segfault in prepare_message
    
    soup_form_request_new_from_hash can return NULL, e.g. if the given url
    is malformed.

 rest/rest-proxy-call.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c
index 341ac8d..6a96e1a 100644
--- a/rest/rest-proxy-call.c
+++ b/rest/rest-proxy-call.c
@@ -844,6 +844,10 @@ prepare_message (RestProxyCall *call, GError **error_out)
                                                hash);
 
     g_hash_table_unref (hash);
+
+    if (!message)
+      return NULL;
+
   } else {
     SoupMultipart *mp;
     RestParamsIter iter;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]