[librest/wip/teuf/gtask: 16/37] RestProxyCall: Prevent segfault in prepare_message



commit da2c013d87b51fd2c391ee9d5d647957806d90eb
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]