Fixed a NULL pointer dereference in form posting

It was introduced in commit eeb2cb05 along with the -F type=
change. Also fixed a typo in the name of the magic filename=
parameter. Tweaked tests 39 and 173 to better test this path.
This commit is contained in:
Dan Fandrich 2010-08-24 16:45:31 -07:00
parent bed311eda2
commit 77ba147e76
3 changed files with 18 additions and 6 deletions

View file

@ -1210,8 +1210,13 @@ static int formparse(struct Configurable *config,
specified and if not we simply assume that it is text that
the user wants included in the type and include that too up
to the next zero or semicolon. */
if((*sep==';') && !curlx_strnequal(";filname=", sep, 9))
sep = strchr(sep+1, ';');
if((*sep==';') && !curlx_strnequal(";filename=", sep, 10)) {
sep2 = strchr(sep+1, ';');
if (sep2)
sep = sep2;
else
sep = sep+strlen(sep); /* point to end of string */
}
if(*sep) {
*sep=0; /* zero terminate type string */