[librest/wip/teuf/gtask: 8/28] RestProxyCall: Prevent segfault in prepare_message



commit 6e98162c8b015b97f7067fefd29204bca692275e
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 09584eb..7cd4c0d 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]