]> git.ipfire.org Git - thirdparty/iptables.git/commit
build: strengthen check for overlong lladdr components
authorJan Engelhardt <jengelh@medozas.de>
Mon, 1 Aug 2011 18:22:04 +0000 (20:22 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 1 Aug 2011 18:28:14 +0000 (20:28 +0200)
commit43896add0eb9c6bc94b7323e76f137d402e0f7fe
tree282cbdf953a0a844c202dd0a5edc50eac5bc2de1
parent41a9b481693b4c43c16d0588cc558dd455168af0
build: strengthen check for overlong lladdr components

ethermac[i] > UINT8_MAX is quite pointless, because ethermac[i] is
just uint8_t. To catch values that are not in the range "00"-"ff", use
a string length check (end-arg>2). I am willingly using 2 there,
because no one is going to specify an Ethernet LL address as
"0x00:0x24:0xbe:0xc2:0x7f:0x16" -- because it is always interpreted as
hexadecimal anyway even without the 0x prefix.

xtoptions.c: In function "xtopt_parse_ethermac":
xtoptions.c:760:3: warning: comparison is always false due to limited range of data type
xtoptions.c:766:2: warning: comparison is always false due to limited range of data type

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
iptables/xtoptions.c