@@ -254,14 +254,15 @@ int json_init(modsec_rec *msr, char **error_msg) {
254
254
* yajl initialization
255
255
*
256
256
* yajl_parser_config definition:
257
- * http://lloyd.github.com /yajl/yajl-1 .0.12/structyajl__parser__config .html
257
+ * http://lloyd.github.io /yajl/yajl-2 .0.1/yajl__parse_8h .html#aec816c5518264d2ac41c05469a0f986c
258
258
*
259
259
* TODO: make UTF8 validation optional, as it depends on Content-Encoding
260
260
*/
261
261
if (msr -> txcfg -> debuglog_level >= 9 ) {
262
262
msr_log (msr , 9 , "yajl JSON parsing callback initialization" );
263
263
}
264
264
msr -> json -> handle = yajl_alloc (& callbacks , NULL , msr );
265
+ yajl_config (msr -> json -> handle , yajl_allow_partial_values , 0 );
265
266
266
267
return 1 ;
267
268
}
@@ -278,6 +279,7 @@ int json_process_chunk(modsec_rec *msr, const char *buf, unsigned int size, char
278
279
if (msr -> json -> status != yajl_status_ok ) {
279
280
/* We need to free the yajl error message later, how to do this? */
280
281
* error_msg = yajl_get_error (msr -> json -> handle , 0 , buf , size );
282
+ return -1 ;
281
283
}
282
284
283
285
return 1 ;
@@ -297,6 +299,7 @@ int json_complete(modsec_rec *msr, char **error_msg) {
297
299
if (msr -> json -> status != yajl_status_ok ) {
298
300
/* We need to free the yajl error message later, how to do this? */
299
301
* error_msg = yajl_get_error (msr -> json -> handle , 0 , NULL , 0 );
302
+ return -1 ;
300
303
}
301
304
302
305
return 1 ;
0 commit comments