From 8e297e829675eaa3b1e486925884c3ee99582678 Mon Sep 17 00:00:00 2001 From: Allan Boll Date: Mon, 20 Nov 2017 12:17:42 -0800 Subject: [PATCH] Allow 0 length JSON requests. 0 len XML and multipart already allowed. (#14) --- apache2/msc_reqbody.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apache2/msc_reqbody.c b/apache2/msc_reqbody.c index fc6b380bb5..8347f5053c 100644 --- a/apache2/msc_reqbody.c +++ b/apache2/msc_reqbody.c @@ -697,7 +697,7 @@ apr_status_t modsecurity_request_body_end(modsec_rec *msr, char **error_msg) { } else if (strcmp(msr->msc_reqbody_processor, "JSON") == 0) { #ifdef WITH_YAJL - if (json_complete(msr, &my_error_msg) < 0) { + if (json_complete(msr, &my_error_msg) < 0 && msr->msc_reqbody_length > 0) { *error_msg = apr_psprintf(msr->mp, "JSON parser error: %s", my_error_msg); msr->msc_reqbody_error = 1; msr->msc_reqbody_error_msg = *error_msg;