summaryrefslogtreecommitdiffstats
path: root/usr.bin/rcs/diff.c
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2006-04-29 05:31:28 +0000
committerray <ray@openbsd.org>2006-04-29 05:31:28 +0000
commit6b99bb86bbfee63d44b56f28a81825af72a4b563 (patch)
treea7f5117ed1cefc9aa5c5a2997c09e65cea814a50 /usr.bin/rcs/diff.c
parentClarify man pages to match -t behavior and pretty up usage strings. (diff)
downloadwireguard-openbsd-6b99bb86bbfee63d44b56f28a81825af72a4b563.tar.xz
wireguard-openbsd-6b99bb86bbfee63d44b56f28a81825af72a4b563.zip
Check return values for all strlcpy, and strlcat calls.
OK xsa@ and probably others.
Diffstat (limited to 'usr.bin/rcs/diff.c')
-rw-r--r--usr.bin/rcs/diff.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/rcs/diff.c b/usr.bin/rcs/diff.c
index 6eecdd738c4..10e74089007 100644
--- a/usr.bin/rcs/diff.c
+++ b/usr.bin/rcs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.2 2006/04/26 15:08:25 xsa Exp $ */
+/* $OpenBSD: diff.c,v 1.3 2006/04/29 05:31:28 ray Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -1182,8 +1182,9 @@ match_function(const long *f, int pos, FILE *fp)
if (p != NULL)
*p = '\0';
if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') {
- strlcpy(lastbuf, (const char *)buf,
- sizeof lastbuf);
+ if (strlcpy(lastbuf, (const char *)buf,
+ sizeof(lastbuf)) >= sizeof(lastbuf))
+ errx(1, "match_function: strlcpy");
lastmatchline = pos;
return lastbuf;
}