mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-20 19:44:56 +02:00
xt_ipv4options: fix an infinite loop
This commit is contained in:

committed by
Jan Engelhardt

parent
b0dc0e6f4c
commit
75cd1d7d6a
@@ -20,6 +20,17 @@ static uint32_t ipv4options_rd(const uint8_t *data, int len)
|
||||
uint32_t opts = 0;
|
||||
|
||||
while (len >= 2) {
|
||||
switch (data[0]) {
|
||||
case IPOPT_END:
|
||||
return opts;
|
||||
case IPOPT_NOOP:
|
||||
--len;
|
||||
++data;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (data[1] < 2 || data[1] > len)
|
||||
return opts;
|
||||
opts |= 1 << (data[0] & 0x1F);
|
||||
len -= data[1];
|
||||
data += data[1];
|
||||
|
Reference in New Issue
Block a user