Fixed false positive MULTIPART_UNMATCHED_BOUNDARY errors

This commit is contained in:
Ervin Hegedus
2018-04-19 19:58:53 +00:00
committed by Felipe Zimmerle
parent 95048d5fcf
commit af4afd348c
2 changed files with 451 additions and 0 deletions

View File

@@ -1482,6 +1482,11 @@ bool Multipart::process(const std::string& data, std::string *error,
&& (strncmp(m_buf + 2, m_boundary.c_str(),
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 */
if (m_boundary_count > 0) {
m_flag_unmatched_boundary = 0;
}
int is_final = 0;
/* Is this the final boundary? */