summaryrefslogtreecommitdiff
path: root/bin/rmail
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 09:09:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 09:09:52 +0000
commitcd64a50f546ecbfd25035373ee745bd04e4e5905 (patch)
tree86a1452cec538b8f5259a45745e95cd1161d04e7 /bin/rmail
parent6153e3b8d9aedd43b1300c4d60217039c9485e02 (diff)
lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu
Diffstat (limited to 'bin/rmail')
-rw-r--r--bin/rmail/rmail.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/rmail/rmail.c b/bin/rmail/rmail.c
index 6a19ca449aa..7e220b17ce5 100644
--- a/bin/rmail/rmail.c
+++ b/bin/rmail/rmail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmail.c,v 1.13 2002/07/04 04:26:40 deraadt Exp $ */
+/* $OpenBSD: rmail.c,v 1.14 2003/03/13 09:09:24 deraadt Exp $ */
/* $NetBSD: rmail.c,v 1.8 1995/09/07 06:51:50 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rmail.c 8.3 (Berkeley) 5/15/95";
#else
-static char rcsid[] = "$OpenBSD: rmail.c,v 1.13 2002/07/04 04:26:40 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rmail.c,v 1.14 2003/03/13 09:09:24 deraadt Exp $";
#endif
#endif /* not lint */
@@ -283,9 +283,11 @@ main(int argc, char *argv[])
if (strchr(*argv, ',') == NULL || strchr(*argv, '<') != NULL)
args[i++] = *argv;
else {
- if ((args[i] = malloc(strlen(*argv) + 3)) == NULL)
+ int len = strlen(*argv) + 3;
+
+ if ((args[i] = malloc(len)) == NULL)
err(EX_TEMPFAIL, "Cannot malloc");
- sprintf (args [i++], "<%s>", *argv);
+ snprintf(args[i++], len, "<%s>", *argv);
}
argv++;
}