]> git.proxmox.com Git - mirror_iproute2.git/commit - lib/bpf.c
lib/bpf: Don't leak fp in bpf_find_mntpt()
authorPhil Sutter <phil@nwl.cc>
Mon, 21 Aug 2017 14:46:51 +0000 (16:46 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:35:07 +0000 (17:35 -0700)
commitc3724e4bc3a6c40dc846f0c3b02934d711bf81fb
tree853d064ed6f86f52ead19c3c119da62a09bc818c
parent6e33f7b0f6e04dd46bea24c3ab28d61e54625dd7
lib/bpf: Don't leak fp in bpf_find_mntpt()

If fopen() succeeded but len != PATH_MAX, the function leaks the open
FILE pointer. Fix this by checking len value before calling fopen().

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
lib/bpf.c