diff options
Diffstat (limited to 'usr.bin/rcs/rcsutil.c')
-rw-r--r-- | usr.bin/rcs/rcsutil.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/rcs/rcsutil.c b/usr.bin/rcs/rcsutil.c index 31119174e33..c1ce031ec7c 100644 --- a/usr.bin/rcs/rcsutil.c +++ b/usr.bin/rcs/rcsutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsutil.c,v 1.7 2006/04/27 07:59:33 xsa Exp $ */ +/* $OpenBSD: rcsutil.c,v 1.8 2006/04/29 05:31:28 ray Exp $ */ /* * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -197,7 +197,8 @@ rcs_choosefile(const char *filename, char *out, size_t len) */ if (strcmp(rcs_suffixes, "") == 0) { fd = open(rcspath, O_RDONLY); - strlcpy(out, rcspath, len); + if (strlcpy(out, rcspath, len) >= len) + errx(1, "rcs_choosefile: truncation"); return (fd); } @@ -263,7 +264,8 @@ rcs_choosefile(const char *filename, char *out, size_t len) xfree(suffixes); fd = open(rcspath, O_RDONLY); - strlcpy(out, rcspath, len); + if (strlcpy(out, rcspath, len) >= len) + errx(1, "rcs_choosefile: truncation"); return (fd); } |