summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r--usr.bin/rcs/rcsprog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 0fe107d0c34..7c024123e03 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.121 2006/04/29 05:10:16 ray Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.122 2006/04/29 05:31:28 ray Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -74,8 +74,9 @@ rcs_init(char *envstr, char **argv, int argvlen)
int argc, error;
char linebuf[256], *lp, *cp;
- strlcpy(linebuf, envstr, sizeof(linebuf));
- memset(argv, 0, argvlen * sizeof(char *));
+ if (strlcpy(linebuf, envstr, sizeof(linebuf)) >= sizeof(linebuf))
+ errx(1, "rcs_init: string truncation");
+ (void)memset(argv, 0, argvlen * sizeof(char *));
error = argc = 0;
for (lp = linebuf; lp != NULL;) {