mirror of
https://github.com/yhirose/cpp-httplib
synced 2026-06-08 18:30:49 +00:00
87d62db46b
strtoul silently accepts a leading "-" and wraps via unsigned arithmetic, so chunk-size "-2" produced ULONG_MAX-1, bypassing the ULONG_MAX guard and letting a client drive the server toward unbounded allocation. Replace strtoul with a manual hex parser that requires at least one hex digit, detects size_t overflow per digit, and accepts only chunk-ext or end-of-line after the digits (RFC 9112 §7.1).