[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: fix error handling
From: |
gnunet |
Subject: |
[gnunet] branch master updated: fix error handling |
Date: |
Mon, 20 Jan 2020 10:56:06 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new f69dbeee2 fix error handling
f69dbeee2 is described below
commit f69dbeee28ec0cacf4ed1ffc4601b59a9178c794
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jan 20 10:52:32 2020 +0100
fix error handling
---
src/json/json_mhd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/json/json_mhd.c b/src/json/json_mhd.c
index 3d3f003be..0cc2e92dc 100644
--- a/src/json/json_mhd.c
+++ b/src/json/json_mhd.c
@@ -186,24 +186,26 @@ inflate_data (struct Buffer *buf)
ret = inflate (&z, 0);
switch (ret)
{
+ case Z_BUF_ERROR:
+ GNUNET_break_op (0);
+ GNUNET_break (Z_OK == inflateEnd (&z));
+ GNUNET_free (tmp);
+ return GNUNET_JSON_PR_JSON_INVALID;
case Z_MEM_ERROR:
GNUNET_break (0);
GNUNET_break (Z_OK == inflateEnd (&z));
GNUNET_free (tmp);
return GNUNET_JSON_PR_OUT_OF_MEMORY;
-
case Z_DATA_ERROR:
GNUNET_break_op (0);
GNUNET_break (Z_OK == inflateEnd (&z));
GNUNET_free (tmp);
return GNUNET_JSON_PR_JSON_INVALID;
-
case Z_NEED_DICT:
GNUNET_break_op (0);
GNUNET_break (Z_OK == inflateEnd (&z));
GNUNET_free (tmp);
return GNUNET_JSON_PR_JSON_INVALID;
-
case Z_OK:
if ((0 < z.avail_out) && (0 == z.avail_in))
{
@@ -231,7 +233,6 @@ inflate_data (struct Buffer *buf)
tmp = GNUNET_realloc (tmp, tmp_size);
z.next_out = (Bytef *) &tmp[z.total_out];
continue;
-
case Z_STREAM_END:
/* decompression successful, make 'tmp' the new 'data' */
GNUNET_free (buf->data);
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: fix error handling,
gnunet <=