From ec61749a682bb1556b919357bb264d628801d86d Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 25 Mar 2014 05:22:00 -0700 Subject: [PATCH] Changes JSON parser to not accept parcial contents Also cleanup installer file. --- apache2/msc_json.c | 5 +- iis/installer.wxs | 1046 ++++++++++++++++++-------------------------- 2 files changed, 437 insertions(+), 614 deletions(-) diff --git a/apache2/msc_json.c b/apache2/msc_json.c index 6efcaecb..4bec0f14 100644 --- a/apache2/msc_json.c +++ b/apache2/msc_json.c @@ -254,7 +254,7 @@ int json_init(modsec_rec *msr, char **error_msg) { * yajl initialization * * yajl_parser_config definition: - * http://lloyd.github.com/yajl/yajl-1.0.12/structyajl__parser__config.html + * http://lloyd.github.io/yajl/yajl-2.0.1/yajl__parse_8h.html#aec816c5518264d2ac41c05469a0f986c * * TODO: make UTF8 validation optional, as it depends on Content-Encoding */ @@ -262,6 +262,7 @@ int json_init(modsec_rec *msr, char **error_msg) { msr_log(msr, 9, "yajl JSON parsing callback initialization"); } msr->json->handle = yajl_alloc(&callbacks, NULL, msr); + yajl_config(msr->json->handle, yajl_allow_partial_values, 0); return 1; } @@ -278,6 +279,7 @@ int json_process_chunk(modsec_rec *msr, const char *buf, unsigned int size, char if (msr->json->status != yajl_status_ok) { /* We need to free the yajl error message later, how to do this? */ *error_msg = yajl_get_error(msr->json->handle, 0, buf, size); + return -1; } return 1; @@ -297,6 +299,7 @@ int json_complete(modsec_rec *msr, char **error_msg) { if (msr->json->status != yajl_status_ok) { /* We need to free the yajl error message later, how to do this? */ *error_msg = yajl_get_error(msr->json->handle, 0, NULL, 0); + return -1; } return 1; diff --git a/iis/installer.wxs b/iis/installer.wxs index 83bebf9e..4e68f896 100644 --- a/iis/installer.wxs +++ b/iis/installer.wxs @@ -3,19 +3,17 @@ # This comment is generated by WixEdit, the specific commandline # arguments for the WiX Toolset are stored here. - candleArgs: -nologo "" -out ".wixobj" -ext WixUtilExtension -ext WixUIExtension -dPlatform="x64" + candleArgs: -nologo "" -out ".wixobj" -ext WixUtilExtension -ext WixUIExtension -arch x64 lightArgs: --> - - - - - - - - + + + + + + @@ -99,394 +97,200 @@ --> + - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -503,255 +307,271 @@ - + - - - - - - - + - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + +(NOT &ModSec64=3) AND (NOT &ModSec32=3) + + + &ModSec64=3 OR &ModSec32=3 + + + + 1 + Installed + Installed + + + 1 + + + + 1 + + + + + + + DisableButton = 1 + + + DisableButton = 0 + + + + 1 + + + + + + + + + + + + + + + + + + Installed + + + + Installed + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + 1 + NOT Installed + Installed AND PATCH + 1 + LicenseAccepted = "1" + Installed + NOT Installed + + &ModSec64=3 OR &ModSec32=3 + (NOT &ModSec64=3) AND (NOT &ModSec32=3) + + &ModSec32=3 + + NOT Installed OR WixUI_InstallMode = "Change" + NOT Installed OR WixUI_InstallMode = "Change" + Installed AND PATCH + NOT Installed OR WixUI_InstallMode = "Change" + Installed AND NOT PATCH + Installed AND PATCH + 1 + 1 + 1 + 1 + 1 + + - - - - - + + NOT Installed AND NOT OLDERVERSIONDETECTED + + + NOT Installed AND NOT OLDERVERSIONDETECTED - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + +