Skip to content

Commit

Permalink
Apply fix from iafonov#28
Browse files Browse the repository at this point in the history
Signed-off-by: Yilin Sun <[email protected]>
  • Loading branch information
imi415 committed Sep 27, 2024
1 parent 772639c commit 9a5afea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions multipart_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len
p->state = s_header_field_start;
break;
}
if(i < 2) {
break; // first '--'
}
if (c != p->multipart_boundary[p->index]) {
return i;
}
Expand Down Expand Up @@ -237,6 +240,7 @@ size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len
multipart_log("s_part_data_almost_boundary");
if (c == LF) {
p->state = s_part_data_boundary;
i += 2; // first '--'
p->lookbehind[1] = LF;
p->index = 0;
break;
Expand Down

0 comments on commit 9a5afea

Please sign in to comment.