From 460a14f4c167f92ba6c42a33854a8a5bc5504797 Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Wed, 5 Dec 2012 13:56:46 +0000 Subject: Avoid overflow of file buffer Submitted by: db Approved by: cperciva MFC after: 2 weeks --- pw/pw_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pw/pw_user.c b/pw/pw_user.c index abf1c35..23a7856 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -394,7 +394,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) /* * 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); -- cgit v1.2.3-56-ge451