lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 11 Jul 2011 10:37:33 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Petr Sabata <contyk@...hat.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH] iproute2: Check getline() return code correctly

On Fri, 10 Jun 2011 14:49:27 +0200
Petr Sabata <contyk@...hat.com> wrote:

> The current implementation is always false, no matter what happens.
> 
> Signed-off-by: Petr Sabata <contyk@...hat.com>
> ---
>  lib/utils.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/utils.c b/lib/utils.c
> index 1b42222..76cadea 100644
> --- a/lib/utils.c
> +++ b/lib/utils.c
> @@ -702,7 +702,7 @@ ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
>  		size_t len1 = 0;
>  		size_t cc1;
>  
> -		if ((cc1 = getline(&line1, &len1, in)) < 0) {
> +		if ((cc1 = getline(&line1, &len1, in)) == (size_t)-1) {
>  			fprintf(stderr, "Missing continuation line\n");
>  			return cc1;
>  		}

The correct fix is to make cc1 a signed variable.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ