From ee42d18772db35fd193219f7200cff2657dff721 Mon Sep 17 00:00:00 2001 From: TianWenXin Date: Thu, 18 Aug 2016 20:35:40 +0800 Subject: [PATCH] fix: Fix weak condition of emit s_part_data --- multipart_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipart_parser.c b/multipart_parser.c index 981dabb..60e7001 100644 --- a/multipart_parser.c +++ b/multipart_parser.c @@ -222,7 +222,7 @@ size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len /* fallthrough */ case s_part_data: multipart_log("s_part_data"); - if (c == CR) { + if (c == CR && i >= len - p->boundary_length - 6) { EMIT_DATA_CB(part_data, buf + mark, i - mark); mark = i; p->state = s_part_data_almost_boundary;