summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2018-04-25 15:08:53 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2018-04-26 22:23:02 +0200
commit815425567dea6c54494e85050631d6bdda907c5d (patch)
treeb4b8abbdd15ea200595ae81616e94af48bd3e4ae /kernel
parent25eb0ea7174c6e84f21fa59dccbddd0318b17b12 (diff)
downloadlinux-815425567dea6c54494e85050631d6bdda907c5d.tar.gz
linux-815425567dea6c54494e85050631d6bdda907c5d.tar.bz2
linux-815425567dea6c54494e85050631d6bdda907c5d.zip
bpf: fix uninitialized variable in bpf tools
Here the variable cont is used as the saved_pointer for a call to strtok_r(). It is safe to use the value uninitialized in this context however and the later reference is only ever used if the strtok_r is successful. But, 'gcc-5' at least doesn't have all this knowledge so initialize cont to NULL. Additionally, do the natural NULL check before accessing just for completness. The warning is the following: ./bpf/tools/bpf/bpf_dbg.c: In function ‘cmd_load’: ./bpf/tools/bpf/bpf_dbg.c:1077:13: warning: ‘cont’ may be used uninitialized in this function [-Wmaybe-uninitialized] } else if (matches(subcmd, "pcap") == 0) { Fixes: fd981e3c321a "filter: bpf_dbg: add minimal bpf debugger" Signed-off-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions