]> git.ipfire.org Git - thirdparty/iproute2.git/commit
lib: bpf_legacy: fix potential NULL-pointer dereference
authorAndrea Claudi <aclaudi@redhat.com>
Sat, 7 Aug 2021 16:57:38 +0000 (18:57 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 11 Aug 2021 02:55:12 +0000 (19:55 -0700)
commit50a412702252ba29524b860df6c30d14f03cd34a
tree0cfa00e769a86b2cc0947daa818f61aeaaa761a0
parent954a0077c83b7981271809391ac0712d24a48314
lib: bpf_legacy: fix potential NULL-pointer dereference

If bpf_map_fetch_name() returns NULL, strlen() hits a NULL-pointer
dereference on outer_map_name.

Fix this checking outer_map_name value, and returning false when NULL,
as already done for inner_map_name before.

Fixes: 6d61a2b55799 ("lib: add libbpf support")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/bpf_legacy.c