summaryrefslogtreecommitdiffstats
path: root/extensions/libebt_arp.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-09-17 13:38:33 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-09-18 01:17:19 +0200
commit6fc7762f6f78526e3cb0c189ac2778a6be4c00b5 (patch)
treed069b6ec58e6ab070fea9bf481c4133d05cdb9c5 /extensions/libebt_arp.c
parent2a68be109c4aac64b4cc9143d0aaa1bb8d77c5d4 (diff)
libxt_string: Fix array out of bounds check
Commit 56d7ab42f3782 ("libxt_string: Avoid potential array out of bounds access") tried to fix parse_hex_string() for overlong strings but the change still allowed for 'sindex' to become XT_STRING_MAX_PATTERN_SIZE which leads to access of first byte after info->pattern. This is not really a problem because it merely overwrites info->patlen before calling xtables_error() later, but covscan still detects it so it's still worth fixing. The crucial bit here is that 'sindex' has to be incremented at end of the last iteration since its value is used for info->patlen. Hence just move the overflow check to the beginning of the loop. Fixes: 56d7ab42f3782 ("libxt_string: Avoid potential array out of bounds access") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'extensions/libebt_arp.c')
0 files changed, 0 insertions, 0 deletions