libmicrohttpd/CVE-2023-27371.patch
starlet-dx 117842d735 Fix CVE-2023-27371
(cherry picked from commit 7ff34701427430d009f7e91e6c397bf7076fd033)
2023-03-13 14:33:57 +08:00

13 lines
594 B
Diff

diff -Naur a/src/microhttpd/postprocessor.c b/src/microhttpd/postprocessor.c
--- a/src/microhttpd/postprocessor.c 2023-03-13 11:20:38.069141187 +0800
+++ b/src/microhttpd/postprocessor.c 2023-03-13 11:21:37.158002318 +0800
@@ -310,7 +310,7 @@
return NULL; /* failed to determine boundary */
boundary += MHD_STATICSTR_LEN_ ("boundary=");
blen = strlen (boundary);
- if ( (blen == 0) ||
+ if ( (blen < 2) ||
(blen * 2 + 2 > buffer_size) )
return NULL; /* (will be) out of memory or invalid boundary */
if ( (boundary[0] == '"') &&