iptables: fix possible NULL pointer access on constructing rule masks
authorJo-Philipp Wich <jo@mein.io>
Fri, 2 Mar 2018 10:36:39 +0000 (11:36 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 2 Mar 2018 10:36:39 +0000 (11:36 +0100)
commit8ef12cb54dbd37466ab10586591eb84338475c2a
treef91e081fd85cc7b0824c8077697c271e3944fe1f
parenta3ef503ed515752f7d1809c8c3238c0e4c7ce150
iptables: fix possible NULL pointer access on constructing rule masks

Due to a misplaced parenthesis, rule_mask() may try to access
r->target->userspacesize through a r->target NULL pointer.

Fix this problem by correcting the parenthesis placement in the memset
expression, using the originally intented operator precedence.

Spotted in the cz.nic fork of firewall3.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
iptables.c