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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"