]> git.proxmox.com Git - mirror_ovs.git/commit
odp-util: Avoid reading wrong table in generate_all_wildcard_mask().
authorBen Pfaff <blp@ovn.org>
Mon, 27 Nov 2017 17:20:57 +0000 (09:20 -0800)
committerBen Pfaff <blp@ovn.org>
Fri, 22 Dec 2017 00:05:45 +0000 (16:05 -0800)
commit464cc3ee5094d799ddfd49cdec5727e0162483ec
treef40678da5981edfe7832b6967a6ad4d4ff549996
parent7dc5969e787f734fd5e07b866808cb21b0fd52f4
odp-util: Avoid reading wrong table in generate_all_wildcard_mask().

These lines of code are intended to copy the 'next' and 'next_max' members
of tbl[type] into local variables 'tbl' and 'max':
            tbl = tbl[type].next;
            max = tbl[type].next_max;
They didn't do it properly because the first line changes 'tbl', so that
the first and seconds lines' references to tbl[type] refer to different
objects.

This commit fixes the problem.

Found by libfuzzer.

Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
lib/odp-util.c