Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec61749

Browse files
author
Felipe Zimmerle
committed
Changes JSON parser to not accept parcial contents
Also cleanup installer file.
1 parent966e7e1 commitec61749

File tree

2 files changed

+426
-603
lines changed

2 files changed

+426
-603
lines changed

‎apache2/msc_json.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,15 @@ int json_init(modsec_rec *msr, char **error_msg) {
254254
* yajl initialization
255255
*
256256
* 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
258258
*
259259
* TODO: make UTF8 validation optional, as it depends on Content-Encoding
260260
*/
261261
if (msr->txcfg->debuglog_level >=9) {
262262
msr_log(msr,9,"yajl JSON parsing callback initialization");
263263
}
264264
msr->json->handle=yajl_alloc(&callbacks,NULL,msr);
265+
yajl_config(msr->json->handle,yajl_allow_partial_values,0);
265266

266267
return1;
267268
}
@@ -278,6 +279,7 @@ int json_process_chunk(modsec_rec *msr, const char *buf, unsigned int size, char
278279
if (msr->json->status!=yajl_status_ok) {
279280
/* We need to free the yajl error message later, how to do this? */
280281
*error_msg=yajl_get_error(msr->json->handle,0,buf,size);
282+
return-1;
281283
}
282284

283285
return1;
@@ -297,6 +299,7 @@ int json_complete(modsec_rec *msr, char **error_msg) {
297299
if (msr->json->status!=yajl_status_ok) {
298300
/* We need to free the yajl error message later, how to do this? */
299301
*error_msg=yajl_get_error(msr->json->handle,0,NULL,0);
302+
return-1;
300303
}
301304

302305
return1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp