Fossil SCM
Cherrypick [71d1127e0a]: In the parser for multipart form data, take the content of each part off the length that remains, so that a later part with no closing boundary is not scanned past the end of the request body.
Commit
940a4fd15c55042be18e8c3a9154844e56f4a7f9b344fae05fb25f95d84ddaf6
Parent
e9ca08136503619…
1 file changed
+1
+1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1092,10 +1092,11 @@ | ||
| 1092 | 1092 | i += nBoundary; |
| 1093 | 1093 | break; |
| 1094 | 1094 | } |
| 1095 | 1095 | } |
| 1096 | 1096 | *pz = &z[i]; |
| 1097 | + *pLen -= i; | |
| 1097 | 1098 | get_line_from_string(pz, pLen); |
| 1098 | 1099 | return z; |
| 1099 | 1100 | } |
| 1100 | 1101 | |
| 1101 | 1102 | /* |
| 1102 | 1103 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1092,10 +1092,11 @@ | |
| 1092 | i += nBoundary; |
| 1093 | break; |
| 1094 | } |
| 1095 | } |
| 1096 | *pz = &z[i]; |
| 1097 | get_line_from_string(pz, pLen); |
| 1098 | return z; |
| 1099 | } |
| 1100 | |
| 1101 | /* |
| 1102 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1092,10 +1092,11 @@ | |
| 1092 | i += nBoundary; |
| 1093 | break; |
| 1094 | } |
| 1095 | } |
| 1096 | *pz = &z[i]; |
| 1097 | *pLen -= i; |
| 1098 | get_line_from_string(pz, pLen); |
| 1099 | return z; |
| 1100 | } |
| 1101 | |
| 1102 | /* |
| 1103 |