diff options
-rw-r--r-- | usr.bin/cvs/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index 290284110c2..29cdece4b53 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.100 2007/01/20 01:07:51 niallo Exp $ */ +/* $OpenBSD: util.c,v 1.101 2007/01/20 16:52:39 thib Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> @@ -625,7 +625,8 @@ cvs_get_repository_name(const char *dir, char *dst, size_t len) fatal("cvs_get_repository_name: truncation"); if ((fp = fopen(fpath, "r")) != NULL) { - fgets(dst, len, fp); + if ((fgets(dst, len, fp)) == NULL) + fatal("cvs_get_repository_name: bad repository file"); if ((s = strchr(dst, '\n')) != NULL) *s = '\0'; |