]> git.ipfire.org Git - thirdparty/util-linux.git/commit - text-utils/hexdump-parse.c
hexdump: fix potential null pointer dereference warnings
authorSami Kerola <kerolasa@iki.fi>
Mon, 10 Dec 2018 21:41:19 +0000 (21:41 +0000)
committerSami Kerola <kerolasa@iki.fi>
Mon, 10 Dec 2018 21:48:00 +0000 (21:48 +0000)
commit577bb86f5b0662ac81699580b55b5a4b11611f01
tree7ed878a063f7d6a86c00c9b9199a30c0f4382a80
parenta81a48779b858b7ab49fff3ed52dec21a26049a5
hexdump: fix potential null pointer dereference warnings

First three fixes on lines 133, 151, and 280 are cosmetic.  Because there
was unobvious null check compiler thought variable might be null, and warned
when after pointer adjustment it was followed without null check.  Perhaps
this will not happen sometime in future when compiler is made more smart,
meanwhile lets give better hints to avoid false positive.

The last change addresses issue that is possible, at least in theory.

text-utils/hexdump-parse.c:465:12: warning: potential null pointer
dereference [-Wnull-dereference]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/hexdump-parse.c