From: deraadt Date: Mon, 16 Dec 1996 18:40:53 +0000 (+0000) Subject: avoid more oflows; at this stage paranoia exceeds reality by a lot since our passwd... X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=260554fb7744e58a41ec8347cb0f4d2740abd138;p=openbsd avoid more oflows; at this stage paranoia exceeds reality by a lot since our passwd suite is fascist --- diff --git a/usr.sbin/cron/entry.c b/usr.sbin/cron/entry.c index 7950cac2f34..2c7fd9f90f5 100644 --- a/usr.sbin/cron/entry.c +++ b/usr.sbin/cron/entry.c @@ -16,7 +16,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: entry.c,v 1.3 1996/12/14 20:20:42 millert Exp $"; +static char rcsid[] = "$Id: entry.c,v 1.4 1996/12/16 18:40:53 deraadt Exp $"; #endif /* vix 26jan87 [RCS'd; rest of log is in RCS file] @@ -256,7 +256,7 @@ load_entry(file, error_func, pw, envp) goto eof; } if (!env_get("SHELL", e->envp)) { - sprintf(envstr, "SHELL=%s", _PATH_BSHELL); + snprintf(envstr, sizeof envstr, "SHELL=%s", _PATH_BSHELL); if ((tenvp = env_set(e->envp, envstr))) { e->envp = tenvp; } else { @@ -265,7 +265,7 @@ load_entry(file, error_func, pw, envp) } } if (!env_get("HOME", e->envp)) { - sprintf(envstr, "HOME=%s", pw->pw_dir); + snprintf(envstr, sizeof envstr, "HOME=%s", pw->pw_dir); if ((tenvp = env_set(e->envp, envstr))) { e->envp = tenvp; } else { @@ -282,7 +282,7 @@ load_entry(file, error_func, pw, envp) goto eof; } } - sprintf(envstr, "%s=%s", "LOGNAME", pw->pw_name); + snprintf(envstr, sizeof envstr, "%s=%s", "LOGNAME", pw->pw_name); if ((tenvp = env_set(e->envp, envstr))) { e->envp = tenvp; } else { @@ -290,7 +290,7 @@ load_entry(file, error_func, pw, envp) goto eof; } #if defined(BSD) - sprintf(envstr, "%s=%s", "USER", pw->pw_name); + snprintf(envstr, sizeof envstr, "%s=%s", "USER", pw->pw_name); if ((tenvp = env_set(e->envp, envstr))) { e->envp = tenvp; } else {