aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-06-06 09:58:08 +0200
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-06-06 09:58:08 +0200
commit122caec56d618d8d86d1fa83ddb38b2a6586c7c4 (patch)
tree88d0e06bda28e26850beeefe0d4db3b3612359cc
parent5859903329d12cb4bf97b4df001692dfdaeee7cd (diff)
fix NPE
-rw-r--r--src/gns/gnunet-gns-proxy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index fb02295c8e..cf1901de10 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1965,7 +1965,7 @@ create_response (void *cls,
us = MHD_lookup_connection_value (con,
MHD_HEADER_KIND,
MHD_HTTP_HEADER_CONTENT_LENGTH);
- if ( (1 == sscanf (us,
+ if ( (NULL != us) && (1 == sscanf (us,
"%ld",
&upload_size)) &&
(upload_size >= 0) )
@@ -1973,6 +1973,10 @@ create_response (void *cls,
curl_easy_setopt (s5r->curl,
CURLOPT_INFILESIZE,
upload_size);
+ } else {
+ curl_easy_setopt (s5r->curl,
+ CURLOPT_INFILESIZE,
+ upload_size);
}
}
}