diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-13 09:09:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-13 09:09:52 +0000 |
commit | cd64a50f546ecbfd25035373ee745bd04e4e5905 (patch) | |
tree | 86a1452cec538b8f5259a45745e95cd1161d04e7 /usr.sbin/edquota | |
parent | 6153e3b8d9aedd43b1300c4d60217039c9485e02 (diff) |
lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu
Diffstat (limited to 'usr.sbin/edquota')
-rw-r--r-- | usr.sbin/edquota/edquota.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index b959ccfd141..dfc093cc9ef 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -42,7 +42,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: edquota.c,v 1.35 2002/09/06 21:49:21 deraadt Exp $"; +static char *rcsid = "$Id: edquota.c,v 1.36 2003/03/13 09:09:46 deraadt Exp $"; #endif /* not lint */ /* @@ -365,14 +365,15 @@ editit(tmpfile) char *argp[] = {"sh", "-c", NULL, NULL}; char *ed, *p; sigset_t mask, omask; - int stat; + int stat, len; if ((ed = getenv("EDITOR")) == (char *)0) ed = _PATH_VI; - p = (char *)malloc(strlen(ed) + 1 + strlen(tmpfile) + 1); + len = strlen(ed) + 1 + strlen(tmpfile) + 1; + p = (char *)malloc(len); if (!p) return(0); - (void)sprintf(p, "%s %s", ed, tmpfile); + (void)snprintf(p, len, "%s %s", ed, tmpfile); argp[2] = p; sigemptyset(&mask); |