Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Aug 2000 22:48:49 -0400
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Warner Losh <imp@village.org>, Kris Kennaway <kris@hub.freebsd.org>
Cc:        audit@FreeBSD.ORG
Subject:   Re: strncpy bugs
Message-ID:  <v04210101b5b13053e745@[128.113.24.47]>
In-Reply-To: <200008042133.PAA13109@harmony.village.org>
References:  <Pine.BSF.4.21.0008041423330.68512-100000@hub.freebsd.org> <200008042133.PAA13109@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At 3:33 PM -0600 8/4/00, Warner Losh wrote:
>
>Usually, I do the following stylaistically:
>	strncpy(dst, src, X);
>	dst[X] = '\0';
>where X is the size of the buffer minus 1.
>
>This goes to show how right Theo de Raadt was with his strlcpy
>API change :-).  Getting this right is too tedious to be left
>to the user.

So, should we change our habits, and use strlcpy fixes instead
of repeatedly rewriting strncpy fixes?


---
Garance Alistair Drosehn           =   gad@eclipse.acs.rpi.edu
Senior Systems Programmer          or  drosih@rpi.edu
Rensselaer Polytechnic Institute


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?v04210101b5b13053e745>