aboutsummaryrefslogtreecommitdiff
path: root/src/json/json_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json/json_helper.c')
-rw-r--r--src/json/json_helper.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/json/json_helper.c b/src/json/json_helper.c
index 6189b7596..03db9ec80 100644
--- a/src/json/json_helper.c
+++ b/src/json/json_helper.c
@@ -125,7 +125,7 @@ parse_variable_data (void *cls,
125 return GNUNET_SYSERR; 125 return GNUNET_SYSERR;
126 } 126 }
127 size = (strlen (str) * 5) / 8; 127 size = (strlen (str) * 5) / 8;
128 if (size >= 1024) 128 if (size >= GNUNET_MAX_MALLOC_CHECKED)
129 { 129 {
130 GNUNET_break_op (0); 130 GNUNET_break_op (0);
131 return GNUNET_SYSERR; 131 return GNUNET_SYSERR;
@@ -135,6 +135,15 @@ parse_variable_data (void *cls,
135 strlen (str), 135 strlen (str),
136 data, 136 data,
137 size); 137 size);
138 if ( (0 < size) &&
139 (GNUNET_OK != res) )
140 {
141 size--;
142 res = GNUNET_STRINGS_string_to_data (str,
143 strlen (str),
144 data,
145 size);
146 }
138 if (GNUNET_OK != res) 147 if (GNUNET_OK != res)
139 { 148 {
140 GNUNET_break_op (0); 149 GNUNET_break_op (0);