aboutsummaryrefslogtreecommitdiff
path: root/src/json/json_generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json/json_generator.c')
-rw-r--r--src/json/json_generator.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index 5806eb174..0c513ca9d 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -42,7 +42,14 @@ GNUNET_JSON_from_data (const void *data,
42 char *buf; 42 char *buf;
43 json_t *json; 43 json_t *json;
44 44
45 buf = GNUNET_STRINGS_data_to_string_alloc (data, size); 45 if ((size * 8 + 4) / 5 + 1 >=
46 GNUNET_MAX_MALLOC_CHECKED)
47 {
48 GNUNET_break (0);
49 return NULL;
50 }
51 buf = GNUNET_STRINGS_data_to_string_alloc (data,
52 size);
46 json = json_string (buf); 53 json = json_string (buf);
47 GNUNET_free (buf); 54 GNUNET_free (buf);
48 GNUNET_break (NULL != json); 55 GNUNET_break (NULL != json);
@@ -201,5 +208,4 @@ GNUNET_JSON_from_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *sig)
201} 208}
202 209
203 210
204
205/* End of json/json_generator.c */ 211/* End of json/json_generator.c */