mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
BUG/MEDIUM: h1: Don't parse chunks CRLF if not enough data are available
As specified in the function comment, the function h1_skip_chunk_crlf() must not
change anything and return zero if not enough data are available. This must
include the case where there is no data at all. On this point, it must do the
same that other h1 parsing functions. This bug is made visible since the commit
91f77d599
("BUG/MINOR: mux-h1: Process input even if the input buffer is
empty").
This patch must be backported to 1.9.
This commit is contained in:
parent
e1afd4fec6
commit
22c57bef56
@ -202,6 +202,9 @@ static inline int h1_skip_chunk_crlf(const struct buffer *buf, int start, int st
|
||||
const char *ptr = b_peek(buf, start);
|
||||
int bytes = 1;
|
||||
|
||||
if (stop <= start)
|
||||
return 0;
|
||||
|
||||
/* NB: we'll check data availability at the end. It's not a
|
||||
* problem because whatever we match first will be checked
|
||||
* against the correct length.
|
||||
|
Loading…
Reference in New Issue
Block a user