svn commit: r243895 - head/usr.sbin/pw

Eitan Adler eadler at FreeBSD.org
Wed Dec 5 13:56:47 UTC 2012


Author: eadler
Date: Wed Dec  5 13:56:46 2012
New Revision: 243895
URL: http://svnweb.freebsd.org/changeset/base/243895

Log:
  Avoid overflow of file buffer
  
  Submitted by:	db
  Approved by:	cperciva
  MFC after:	2 weeks

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Wed Dec  5 13:56:43 2012	(r243894)
+++ head/usr.sbin/pw/pw_user.c	Wed Dec  5 13:56:46 2012	(r243895)
@@ -394,7 +394,7 @@ pw_user(struct userconf * cnf, int mode,
 				/*
 				 * Remove crontabs
 				 */
-				sprintf(file, "/var/cron/tabs/%s", pwd->pw_name);
+				snprintf(file, sizeof(file), "/var/cron/tabs/%s", pwd->pw_name);
 				if (access(file, F_OK) == 0) {
 					sprintf(file, "crontab -u %s -r", pwd->pw_name);
 					system(file);


More information about the svn-src-head mailing list