--- libaitwww/src/aitwww.c 2012/03/09 12:47:06 1.1.1.1.2.4 +++ libaitwww/src/aitwww.c 2012/03/09 16:42:31 1.1.1.1.2.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitwww.c,v 1.1.1.1.2.4 2012/03/09 12:47:06 misho Exp $ +* $Id: aitwww.c,v 1.1.1.1.2.7 2012/03/09 16:42:31 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -135,8 +135,9 @@ www_initCGI(void) if (!str) { LOGERR; return NULL; - } - for (i = 0; i < ctlen && (rlen = + } else + memset(str, 0, ctlen + 1); + for (i = 0; i <= ctlen && (rlen = read(STDIN_FILENO, (void*) str + i, ctlen - i)) > 0; i += rlen); str[ctlen] = 0; @@ -532,6 +533,10 @@ www_parseMultiPart(const char *str, int ctlen, const c SLIST_FOREACH(m, mime, mime_node) { s = mime_getValue(m, "content-disposition"); attr = www_parseAttributes(&s); + if (!www_getAttribute(attr, "name")) { + www_freeAttributes(&attr); + continue; + } t = malloc(sizeof(struct tagCGI)); if (!t) {