From 4d0ca94490fdcc233228987c6b10ef010d967249 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Mon, 4 Jun 2018 12:13:32 +0000 Subject: [PATCH] Modified the false pos. UNMATCHED_BOUNDARY error flag --- src/request_body_processor/multipart.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/request_body_processor/multipart.cc b/src/request_body_processor/multipart.cc index 6e2d14bb..9238d472 100644 --- a/src/request_body_processor/multipart.cc +++ b/src/request_body_processor/multipart.cc @@ -1483,9 +1483,15 @@ bool Multipart::process(const std::string& data, std::string *error, m_boundary.size()) == 0)) { char *boundary_end = m_buf + 2 + m_boundary.size(); /* if it match, AND there was a matched boundary at least, - clear the m_flag_unmatched_boundary flag */ + set the m_flag_unmatched_boundary flag to 2 + this indicates that there were an opened boundary, which + matches the reference, and here is the final boundary. + The flag will differ from 0, so the previous rules ("!@eq 0") + will catch all "errors", without any modification, but we can + use the new, permission mode with "@eq 1" + */ if (m_boundary_count > 0) { - m_flag_unmatched_boundary = 0; + m_flag_unmatched_boundary = 2; } int is_final = 0;