Date: Sun, 17 Aug 2003 05:24:49 +0900 From: Hajimu UMEMOTO <ume@mahoroba.org> To: Pawel Jakub Dawidek <nick@garage.freebsd.pl> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/rtsold if.c Message-ID: <ygebrupl59q.wl%ume@mahoroba.org> In-Reply-To: <20030816195657.GV395@garage.freebsd.pl> References: <200308161900.h7GJ0W66093273@repoman.freebsd.org> <20030816195657.GV395@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, >>>>> On Sat, 16 Aug 2003 21:56:57 +0200 >>>>> Pawel Jakub Dawidek <nick@garage.freebsd.pl> said: nick> [1 <text/plain; iso-8859-2 (quoted-printable)>] nick> On Sat, Aug 16, 2003 at 12:00:32PM -0700, Hajimu UMEMOTO wrote: nick> [...] nick> +> - use strncpy just in case. nick> [...] nick> +> @@ -333,7 +333,7 @@ get_llflag(const char *name) nick> +> continue; nick> +> nick> +> memset(&ifr6, 0, sizeof(ifr6)); nick> +> - strcpy(ifr6.ifr_name, name); nick> +> + strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); nick> +> memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); nick> +> if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { nick> +> warnmsg(LOG_ERR, __func__, nick> If so, this should be: nick> strncpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name) - 1); nick> or even better: nick> strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); Yes, it should be so. I've just committed it and sent the patch to KAME. Thank you. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygebrupl59q.wl%ume>