Skip to content
Permalink
Browse files

Fix crash in multipart handling

Close cesanta/dev#6974

PUBLISHED_FROM=4d4e4a46eceba10aec8dacb7f8f58bd078c92307
  • Loading branch information...
alashkin authored and cesantabot committed Apr 3, 2017
1 parent 06c5c4d commit b8402ed0733e3f244588b61ad5fedd093e3cf9cc
Showing with 6 additions and 0 deletions.
  1. +6 −0 mongoose.c
@@ -5961,6 +5961,12 @@ static int mg_http_multipart_wait_for_boundary(struct mg_connection *c) {
struct mbuf *io = &c->recv_mbuf;
struct mg_http_proto_data *pd = mg_http_get_proto_data(c);

if (pd->mp_stream.boundary == NULL) {
pd->mp_stream.state = MPS_FINALIZE;
DBG(("Invalid request: boundary not initilaized"));
return 0;
}

if ((int) io->len < pd->mp_stream.boundary_len + 2) {
return 0;
}

2 comments on commit b8402ed

@rojer

This comment has been minimized.

Copy link
Contributor

replied Apr 7, 2017

the same fix was published to this repo as well - 02b7399

@nksCH

This comment has been minimized.

Copy link

replied Apr 7, 2017

Ah okay, i missed that.

Thanks

Please sign in to comment.
You can’t perform that action at this time.