-
Notifications
You must be signed in to change notification settings - Fork 8k
fix: the rfc1867 multipart form data parser performs... in rfc1867.c #21923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,8 @@ static void normalize_protected_variable(char *varname) /* {{{ */ | |
|
|
||
| /* and remove it */ | ||
| if (s != varname) { | ||
| memmove(varname, s, strlen(s)+1); | ||
| size_t slen = strlen(s) + 1; | ||
| memmove(varname, s, slen); | ||
| } | ||
|
|
||
| for (p = varname; *p && *p != '['; p++) { | ||
|
|
@@ -596,6 +597,9 @@ static size_t multipart_buffer_read(multipart_buffer *self, char *buf, size_t by | |
| } | ||
|
|
||
| /* maximum number of bytes we are reading */ | ||
| if (bytes == 0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, the new bytes == 0 early return does not address the claimed remote memcpy() |
||
| return 0; | ||
| } | ||
| len = max < bytes-1 ? max : bytes-1; | ||
|
|
||
| /* if we read any data... */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same thing to the original code, seems like this does not add a bounds check as you've described...?