mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 01:33:53 +00:00
detail::read_content_chunked was using std::stoul to parse the hexadecimal chunk lengths for "Transfer-Encoding: chunked" requests. This throws an exception if the string does not begin with any valid digits. read_content_chunked is not called in the context of a try block so this caused the process to terminate. Rather than use exceptions, I opted for std::stroul, which is similar to std::stoul but does not throw exceptions. Since malformed user input is not particularly exceptional, and some projects are compiled without exception support, this approach seems both more portable and more correct.