Date: Fri, 26 Oct 2001 11:34:21 -0400 (EDT) From: "Andrew R. Reiter" <arr@watson.org> To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/31507: Risk of buffer overflow in struct sockaddr_un Message-ID: <Pine.NEB.3.96L.1011026113237.88071B-100000@fledge.watson.org> In-Reply-To: <200110261520.f9QFK1e07958@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 26 Oct 2001, Garrett Wollman wrote: : No, the correct code would ALWAYS be: : : strncpy(server.sun_path, file_fifo, sizeof server.sun_path); Does this handle off-by-one situations? Also, in terms of using strncpy, would it be more wise to utilize strlcpy() rather than a strncpy()/buf[sizeof(buf)-1] = 0; throughout the tree? Or has strlcpy() had some negative feedback? Cheers, Andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1011026113237.88071B-100000>