Date: Sun, 9 Nov 2008 16:38:19 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: Matteo Riondato <matteo@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184779 - head/usr.sbin/cron/crontab Message-ID: <20081109143819.GO18100@deviant.kiev.zoral.com.ua> In-Reply-To: <20081109132026.GL18100@deviant.kiev.zoral.com.ua> References: <200811090644.mA96ira1032670@svn.freebsd.org> <20081109132026.GL18100@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--hA47Z5c7pMOLFxYj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 09, 2008 at 03:20:26PM +0200, Kostik Belousov wrote: > On Sun, Nov 09, 2008 at 06:44:53AM +0000, Matteo Riondato wrote: > > Author: matteo > > Date: Sun Nov 9 06:44:53 2008 > > New Revision: 184779 > > URL: http://svn.freebsd.org/changeset/base/184779 > >=20 > > Log: > > Be paranoid and use snprintf > > =20 > > PR: bin/122137 > > Submitted by: Steven Kreuzer <skreuzer@exit2shell.com> > > MFC after: 3 days > >=20 > > Modified: > > head/usr.sbin/cron/crontab/crontab.c > >=20 > > Modified: head/usr.sbin/cron/crontab/crontab.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 01:53:06 2008 (r184= 778) > > +++ head/usr.sbin/cron/crontab/crontab.c Sun Nov 9 06:44:53 2008 (r184= 779) > > @@ -263,7 +263,7 @@ list_cmd() { > > FILE *f; > > =20 > > log_it(RealUser, Pid, "LIST", User); > > - (void) sprintf(n, CRON_TAB(User)); > > + (void) snprintf(n, sizeof(n), CRON_TAB(User)); > This note is probably also about paranoia instead of exploitable bug. > I think that it is better to use %s format explicitely instead of > expecting no '%' in the CRON_TAB(User). Please, ignore this. I should have looked at the actual code. --hA47Z5c7pMOLFxYj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkW9dsACgkQC3+MBN1Mb4gG/ACfcYQ3yoHewHoYFlrDkrcPGfeV oWEAoN3/Q004t/j0zoJ6oNwuFu5wiqI5 =hS4L -----END PGP SIGNATURE----- --hA47Z5c7pMOLFxYj--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081109143819.GO18100>