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
@ -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;
|
||||
}
|
||||
|
||||
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 */
|
||||
smp->flags = 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)
|
||||
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 */
|
||||
smp->flags = 0;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user