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>
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 @@
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;
}