Date: Fri, 04 Aug 2000 22:40:31 -0600 From: Warner Losh <imp@village.org> To: Kris Kennaway <kris@FreeBSD.org> Cc: audit@FreeBSD.org Subject: Re: strncpy bugs Message-ID: <200008050440.WAA14655@harmony.village.org> In-Reply-To: Your message of "Fri, 04 Aug 2000 18:47:04 PDT." <Pine.BSF.4.21.0008041845460.53937-100000@freefall.freebsd.org> References: <Pine.BSF.4.21.0008041845460.53937-100000@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.21.0008041845460.53937-100000@freefall.freebsd.org> Kris Kennaway writes: : At least a few, I'd guess. I also noticed fencepost errors in some of the : OpenBSD fixes a while back, although I dont have a record of these and : promised to submit them when I came across them again. Most of the ones that I saw didn't have fencepost errors, although people thought they might. They were of the form strncpy(foo, bar, sizeof(foo)); foo[sizeof(foo) - 1] = '\0'; which some people will whine about saying that the last parameter should be sizeof(foo) - 1, but the above and the following have exactly the same post conditions: strncpy(foo, bar, sizeof(foo) - 1); foo[sizeof(foo) - 1] = '\0'; Warner 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?200008050440.WAA14655>