aboutsummaryrefslogtreecommitdiff
path: root/src/json/json_generator.c
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-07-19 19:54:18 +0200
committert3sserakt <t3ss@posteo.de>2021-07-19 20:26:54 +0200
commit7a1ec37c139263e4ccb056ebf9ab4582923961d2 (patch)
treedf4cfb02e01871e38a335c796039945c700006d4 /src/json/json_generator.c
parent9d7ff3c3fbee189367da05a1517777c76a80b23b (diff)
parent24433cf8d1241991b5a264ef81dc26868b50b90e (diff)
downloadgnunet-7a1ec37c139263e4ccb056ebf9ab4582923961d2.tar.gz
gnunet-7a1ec37c139263e4ccb056ebf9ab4582923961d2.zip
Merge branch 'master' of ssh://gnunet.org/gnunet
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 */