diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2004-07-14 04:12:44 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2004-07-14 04:12:44 +0000 |
commit | e258cf2fab6e8a657d94f22b30ce59ffad54a32b (patch) | |
tree | 0034913b3b974e7b3a0ea1568ded596b8c331ef5 /usr.bin | |
parent | 4058f2d96b457ca49db5ab864cd074fd45b300c9 (diff) |
/* line is not NUL-terminated */
so don't strlcpy!
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/root.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c index 3b34a38fb5b..f4e73c57329 100644 --- a/usr.bin/cvs/root.c +++ b/usr.bin/cvs/root.c @@ -1,4 +1,4 @@ -/* $OpenBSD: root.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: root.c,v 1.2 2004/07/14 04:12:43 vincent Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -251,7 +251,8 @@ cvsroot_get(const char *dir) (void)fclose(fp); return (NULL); } - strlcpy(rootstr, line, len); + memcpy(rootstr, line, len); + rootstr[len] = '\0'; rp = cvsroot_parse(rootstr); (void)fclose(fp); |