mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-17 00:44:33 +00:00
BUG/MEDIUM: stick-table: properly convert binary samples to keys
The binary sample to stick-table key conversion is wrong. It doesn't check that the binary sample is writable before padding it. After a quick audit, it doesn't look like any existing sample fetch function can trigger this bug. The correct fix consists in calling smp_make_rw() prior to padding the sample. This fix should be backported to 1.6.
This commit is contained in:
parent
ce6955e632
commit
f65c6c0456
@ -505,6 +505,9 @@ struct stktable_key *smp_to_stkey(struct sample *smp, struct stktable *t)
|
||||
case SMP_T_BIN:
|
||||
if (smp->data.u.str.len < t->key_size) {
|
||||
/* This type needs padding with 0. */
|
||||
if (!smp_make_rw(smp))
|
||||
return NULL;
|
||||
|
||||
if (smp->data.u.str.size < t->key_size)
|
||||
if (!smp_dup(smp))
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user