mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 08:20:19 -05:00
MEDIUM: shctx: forbid shctx to read more than expected
Forbid shctx to read more than expected, it allows you to use a greater value as a len with shctx_row_data_get(), the size of the destination buffer for example.
This commit is contained in:
parent
3f133570b8
commit
7217c46dfe
1 changed files with 4 additions and 0 deletions
|
|
@ -209,6 +209,10 @@ int shctx_row_data_get(struct shared_context *shctx, struct shared_block *first,
|
|||
int count = 0, size = 0, start = -1;
|
||||
struct shared_block *block;
|
||||
|
||||
/* can't copy more */
|
||||
if (len > first->len)
|
||||
len = first->len;
|
||||
|
||||
block = first;
|
||||
count = 0;
|
||||
/* Pass through the blocks to copy them */
|
||||
|
|
|
|||
Loading…
Reference in a new issue