mirror of
https://github.com/curl/curl.git
synced 2025-04-24 16:40:32 +08:00
prevent a single byte read outside the string in test case 39
This commit is contained in:
parent
52e1ce9518
commit
a137223b4f
@ -863,7 +863,6 @@ static int formparse(char *input,
|
|||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
if(curlx_strnequal("type=", ptr, 5)) {
|
if(curlx_strnequal("type=", ptr, 5)) {
|
||||||
|
|
||||||
/* set type pointer */
|
/* set type pointer */
|
||||||
type = &ptr[5];
|
type = &ptr[5];
|
||||||
|
|
||||||
@ -878,10 +877,14 @@ static int formparse(char *input,
|
|||||||
/* now point beyond the content-type specifier */
|
/* now point beyond the content-type specifier */
|
||||||
sep = (char *)type + strlen(major)+strlen(minor)+1;
|
sep = (char *)type + strlen(major)+strlen(minor)+1;
|
||||||
|
|
||||||
|
if(*sep) {
|
||||||
*sep=0; /* zero terminate type string */
|
*sep=0; /* zero terminate type string */
|
||||||
|
|
||||||
ptr=sep+1;
|
ptr=sep+1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ptr = NULL; /* end */
|
||||||
|
}
|
||||||
else if(curlx_strnequal("filename=", ptr, 9)) {
|
else if(curlx_strnequal("filename=", ptr, 9)) {
|
||||||
filename = &ptr[9];
|
filename = &ptr[9];
|
||||||
ptr=strchr(filename, FORM_TYPE_SEPARATOR);
|
ptr=strchr(filename, FORM_TYPE_SEPARATOR);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user