@@ -304,10 +304,12 @@ int xml_complete(modsec_rec *msr, char **error_msg) {
304304
305305 /* Only if we have a context, meaning we've done some work. */
306306 if (msr -> xml -> parsing_ctx != NULL || msr -> xml -> parsing_ctx_arg != NULL ) {
307+ int terminate = !msr -> reqbody_partial_processing_enabled ;
308+
307309 if (msr -> xml -> parsing_ctx != NULL &&
308310 msr -> txcfg -> parse_xml_into_args != MSC_XML_ARGS_ONLYARGS ) {
309311 /* This is how we signal the end of parsing to libxml. */
310- xmlParseChunk (msr -> xml -> parsing_ctx , NULL , 0 , 1 );
312+ xmlParseChunk (msr -> xml -> parsing_ctx , NULL , 0 , terminate );
311313
312314 /* Preserve the results for our reference. */
313315 msr -> xml -> well_formed = msr -> xml -> parsing_ctx -> wellFormed ;
@@ -326,7 +328,7 @@ int xml_complete(modsec_rec *msr, char **error_msg) {
326328
327329 if (msr -> xml -> parsing_ctx_arg != NULL &&
328330 msr -> txcfg -> parse_xml_into_args != MSC_XML_ARGS_OFF ) {
329- if (xmlParseChunk (msr -> xml -> parsing_ctx_arg , NULL , 0 , 1 ) != 0 ) {
331+ if (xmlParseChunk (msr -> xml -> parsing_ctx_arg , NULL , 0 , terminate ) != 0 ) {
330332 if (msr -> xml -> xml_error ) {
331333 * error_msg = msr -> xml -> xml_error ;
332334 }
0 commit comments