mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 23:05:49 +01:00
PR: bin/8680
Minor adjustments to rwall.c. Increased the size of a couple of char arrays and replaced a potentially dangeerous strcpy/strcat with snprintf().
This commit is contained in:
parent
98df703fe0
commit
de7c546760
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41718
@ -43,7 +43,7 @@ static const char copyright[] =
|
||||
static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: rwall.c,v 1.5 1997/02/22 19:56:55 peter Exp $";
|
||||
"$Id: rwall.c,v 1.6 1997/08/08 12:18:16 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -134,10 +134,9 @@ makemsg(fname)
|
||||
time_t now, time();
|
||||
FILE *fp;
|
||||
int fd;
|
||||
char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[15];
|
||||
char *whom, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64];
|
||||
|
||||
(void)strcpy(tmpname, _PATH_TMP);
|
||||
(void)strcat(tmpname, "wall.XXXXXX");
|
||||
snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
|
||||
if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
|
||||
errx(1, "can't open temporary file");
|
||||
(void)unlink(tmpname);
|
||||
|
Loading…
Reference in New Issue
Block a user