mirror of
https://github.com/curl/curl.git
synced 2026-07-30 12:28:04 +03:00
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:
parent
bed311eda2
commit
77ba147e76
3 changed files with 18 additions and 6 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue