]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tools: avoid potential null pointer dereference by GCC 10
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Thu, 13 Aug 2020 14:03:45 +0000 (16:03 +0200)
committerErik Skultety <eskultet@redhat.com>
Mon, 17 Aug 2020 06:25:28 +0000 (08:25 +0200)
commite2bd2af6e4f9323cf732563b430ef02e075fc804
treed7153345a27056f0c1870aeec24d45ee15102292
parentd96d359a032cda609f9adf3caafdf8425d8aa4ac
tools: avoid potential null pointer dereference by GCC 10

GCC 10 complains about "arg" possibly being a NULL dereference.
Even though it might be a false positive, we can easily avoid it.

Avoiding
 ../tools/vsh.c: In function ‘vshCommandOptStringReq’:
 ../tools/vsh.c:1034:19: error: potential null pointer dereference [-Werror=null-dereference]
  1034 |     else if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK))
       |                ~~~^~~~~~

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
tools/vsh.c