-
Dimitri Papadopoulos Orfanos authored
Fortinet servers appear to be abusing RFC 9112: chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF chunk-size = 1*HEXDIG chunk-ext = *( BWS ";" BWS chunk-ext-name [ BWS "=" BWS chunk-ext-val ] ) They add spaces (BWS) at the end of chunk-size, even in the absence of chunk-ext. Be lenient when parsing chunk: 1. Accept bogus chunk-ext, with ";" not followed by chunk-ext-name. 2. Discard leading/trailing spaces in chunk-size, strtol() will do that for us. Signed-off-by: Dimitri Papadopoulos Orfanos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>