From 077b9eb7a446f7460386377d377c5c08ee7ed2ea Mon Sep 17 00:00:00 2001 From: Alexander Alashkin <alexander.alashkin@cesanta.com> Date: Mon, 14 Mar 2016 13:46:12 +0100 Subject: [PATCH] Fix var initialization PUBLISHED_FROM=87ce6442efb2c725025942381c01ae2a2de738c7 --- mongoose.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mongoose.c b/mongoose.c index 53231e9fb..ffd8a1759 100644 --- a/mongoose.c +++ b/mongoose.c @@ -5073,6 +5073,8 @@ void mg_http_handler(struct mg_connection *nc, int ev, void *ev_data) { * MG_EV_HTTP_PART_END with error flag */ struct mg_http_multipart_part mp; + memset(&mp, 0, sizeof(mp)); + mp.status = -1; mp.var_name = pd->mp_stream.var_name; mp.file_name = pd->mp_stream.file_name; @@ -5288,6 +5290,7 @@ static void mg_http_multipart_continue(struct mg_connection *nc, int req_len; struct mg_http_proto_data *pd = mg_http_get_proto_data(nc); + memset(&mp, 0, sizeof(mp)); mp.var_name = pd->mp_stream.var_name; mp.file_name = pd->mp_stream.file_name; boundary = c_strnstr(io->buf, pd->mp_stream.boundary, io->len); -- GitLab