Commit 3c0fcf1
committed
client: perform stricter HTTP request parsing
Introduce infrastructure and logic to perform less lenient parsing of
HTTP request headers, chunk size headers and content-length values.
We can not rely on `strtoul()` to parse hexadecimal chunk sizes or
content length values as it accepts a wider range of inputs than what
is allowed by the HTTP spec.
Decode the chunk sizes and length values manually and fix skipping
chunk extension headers while we're at it. Also ensure that there's
no trailing garbage after the size and that we bail out on overflows.
Also rework the parsing of request header lines, to reject malformed
header lines or illegal header names.
Fixes: #3
Fixes: #5
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
wip http parsing
Signed-off-by: Jo-Philipp Wich <jo@mein.io>1 parent 274e6f8 commit 3c0fcf1
1 file changed
+289
-64
lines changed
0 commit comments