Skip to content

Commit be5feee

Browse files
committed
Process an incomplete boundary as a non-final boundary
1 parent 61d4e45 commit be5feee

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

apache2/msc_multipart.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,15 +1086,13 @@ int multipart_complete(modsec_rec *msr, char **error_msg) {
10861086
msr->mpd->is_complete = 1;
10871087
}
10881088
else if (msr->mpd->allow_process_partial == 1) {
1089-
int is_final = 0;
10901089
if (buf_data_len >= 2 + boundary_len + 1) {
10911090
if (*(msr->mpd->buf + 2 + boundary_len) == '-') {
10921091
if ( (buf_data_len >= 2 + boundary_len + 2)
10931092
&& (*(msr->mpd->buf + 2 + boundary_len + 1) != '-') ) {
10941093
*error_msg = apr_psprintf(msr->mp, "Multipart: Invalid final boundary.");
10951094
return -1;
10961095
}
1097-
is_final = 1;
10981096
}
10991097
else if ( (*(msr->mpd->buf + 2 + boundary_len) != '\r')
11001098
|| ((buf_data_len >= 2 + boundary_len + 2)
@@ -1103,8 +1101,8 @@ int multipart_complete(modsec_rec *msr, char **error_msg) {
11031101
return -1;
11041102
}
11051103
}
1106-
1107-
if (multipart_process_boundary(msr, is_final, error_msg) < 0) {
1104+
/* process it as a non-final boundary to avoid building a new part. */
1105+
if (multipart_process_boundary(msr, 0, error_msg) < 0) {
11081106
msr->mpd->flag_error = 1;
11091107
return -1;
11101108
}

0 commit comments

Comments
 (0)