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.

stephan 2026-11-18 17:45 UTC trunk
Commit 940a4fd15c55042be18e8c3a9154844e56f4a7f9b344fae05fb25f95d84ddaf6
1 file changed +1
+1
--- src/cgi.c
+++ src/cgi.c
@@ -1092,10 +1092,11 @@
10921092
i += nBoundary;
10931093
break;
10941094
}
10951095
}
10961096
*pz = &z[i];
1097
+ *pLen -= i;
10971098
get_line_from_string(pz, pLen);
10981099
return z;
10991100
}
11001101
11011102
/*
11021103
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button