mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-09 09:30:46 -04:00
BUG/MEDIUM: payload: make req.payload and payload_lv aware of dynamic buffers
Due to a check between offset+len and buf->size, an empty buffer returns "will never match". Check against tune.bufsize instead. (cherry picked from commit 43e4039fd5d208fd9d32157d20de93d3ddf9bc0d)
This commit is contained in:
parent
c4b56e4470
commit
d7bdcb874b
1 changed files with 2 additions and 2 deletions
|
|
@ -670,7 +670,7 @@ smp_fetch_payload_lv(const struct arg *arg_p, struct sample *smp, const char *kw
|
||||||
buf_offset = arg_p[2].data.sint >> 1;
|
buf_offset = arg_p[2].data.sint >> 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!buf_size || buf_size > chn->buf->size || buf_offset + buf_size > chn->buf->size) {
|
if (!buf_size || buf_size > global.tune.bufsize || buf_offset + buf_size > global.tune.bufsize) {
|
||||||
/* will never match */
|
/* will never match */
|
||||||
smp->flags = 0;
|
smp->flags = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -702,7 +702,7 @@ smp_fetch_payload(const struct arg *arg_p, struct sample *smp, const char *kw, v
|
||||||
if (!chn->buf)
|
if (!chn->buf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (buf_size > chn->buf->size || buf_offset + buf_size > chn->buf->size) {
|
if (!buf_size || buf_size > global.tune.bufsize || buf_offset + buf_size > global.tune.bufsize) {
|
||||||
/* will never match */
|
/* will never match */
|
||||||
smp->flags = 0;
|
smp->flags = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue