mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 04:31:49 +02:00
BUG/MINOR: net_helper: fix incomplete decoding in sample_conv_eth_vlan
sample_conv_eth_vlan() reads the VLAN TCI at area[idx + 2] without ensuring there are enough bytes. The original condition 'idx + 4 < data' breaks when there IS room for more data, leading to an incomplete read when trying to decode a VLAN ID. This can be backported where this converter was backported.
This commit is contained in:
parent
afa32223b1
commit
80ca27be42
@ -110,9 +110,8 @@ static int sample_conv_eth_vlan(const struct arg *arg_p, struct sample *smp, voi
|
||||
smp->flags &= ~SMP_F_CONST;
|
||||
return !!vlan;
|
||||
}
|
||||
if (idx + 4 < smp->data.u.str.data)
|
||||
if (idx + 4 > smp->data.u.str.data)
|
||||
break;
|
||||
|
||||
vlan = read_n16(smp->data.u.str.area + idx + 2) & 0xfff;
|
||||
}
|
||||
/* incomplete header */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user