Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Aug 2001 20:19:13 -0400
From:      Mike Barcroft <mike@FreeBSD.org>
To:        "Andrew R. Reiter" <arr@watson.org>
Cc:        audit@FreeBSD.org
Subject:   Re: rshd.c diff [openbsd updates]
Message-ID:  <20010817201913.A42780@coffee.q9media.com>
In-Reply-To: <Pine.NEB.3.96L.1010817094643.7968A-200000@fledge.watson.org>; from arr@watson.org on Fri, Aug 17, 2001 at 09:48:37AM -0400
References:  <Pine.NEB.3.96L.1010817094643.7968A-200000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 17, 2001 at 09:48:37AM -0400, Andrew R. Reiter wrote:
> Patch for moving strncpy's to strlcpy's is attached... And can also be
> found at:
> 
> http://www.watson.org/fbsd-audit/libexec/rshd/rshd.c.08172001.diff

[...]
> -			strncpy(locuser, cp, sizeof(locuser));
> -			locuser[sizeof(locuser) - 1] = '\0';
> +			strlcpy(locuser, cp, sizeof(locuser)-1);
[...]

Why are you removing an extra character here?  Also, it might be
usefully to check the return value of strlcpy(3) and error out.  I
haven't actually looked at the code, so I'm not sure.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010817201913.A42780>