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>
This commit is contained in:
Thomas Huth 2019-08-26 14:50:17 +02:00 committed by Alexey Kardashevskiy
parent 44d06f9e68
commit eeed8a10a8
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ int ping(char *args_fs, int alen)
memset(&ping_args, 0, sizeof(struct ping_args)); memset(&ping_args, 0, sizeof(struct ping_args));
if (alen <= 0 && alen >= sizeof(args) - 1) { if (alen <= 0 || alen >= sizeof(args) - 1) {
usage(); usage();
return -1; return -1;
} }