Skip to content

Commit 9a5afea

Browse files
committed
Apply fix from iafonov#28
Signed-off-by: Yilin Sun <[email protected]>
1 parent 772639c commit 9a5afea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

multipart_parser.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len
141141
p->state = s_header_field_start;
142142
break;
143143
}
144+
if(i < 2) {
145+
break; // first '--'
146+
}
144147
if (c != p->multipart_boundary[p->index]) {
145148
return i;
146149
}
@@ -237,6 +240,7 @@ size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len
237240
multipart_log("s_part_data_almost_boundary");
238241
if (c == LF) {
239242
p->state = s_part_data_boundary;
243+
i += 2; // first '--'
240244
p->lookbehind[1] = LF;
241245
p->index = 0;
242246
break;

0 commit comments

Comments
 (0)