aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-08-26 14:50:17 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2019-08-27 12:00:36 +1000
commiteeed8a10a8dfcd3a1469066406e56b4bd91cdef2 (patch)
treef3606197eef0df9b89d1414ae42917c6373c93fa /lib
parent44d06f9e68cfc23f4316f0d5d3738c98f0403277 (diff)
downloadSLOF-eeed8a10a8dfcd3a1469066406e56b4bd91cdef2.zip
SLOF-eeed8a10a8dfcd3a1469066406e56b4bd91cdef2.tar.gz
SLOF-eeed8a10a8dfcd3a1469066406e56b4bd91cdef2.tar.bz2
libnet: Fix the check of the argument lengths of the "ping" command
The current if-condition can never be true. Buglink: https://bugs.launchpad.net/qemu/+bug/1840646 Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r--lib/libnet/ping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libnet/ping.c b/lib/libnet/ping.c
index 051269f..51db061 100644
--- a/lib/libnet/ping.c
+++ b/lib/libnet/ping.c
@@ -119,7 +119,7 @@ int ping(char *args_fs, int alen)
memset(&ping_args, 0, sizeof(struct ping_args));
- if (alen <= 0 && alen >= sizeof(args) - 1) {
+ if (alen <= 0 || alen >= sizeof(args) - 1) {
usage();
return -1;
}