summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/root.c
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2007-01-18 22:52:24 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2007-01-18 22:52:24 +0000
commit1d26cf51c226cb7811238005ccf6d357c9560281 (patch)
treec16849ca5b1a8629f77ed1e16cd8bb7eeac5990d /usr.bin/cvs/root.c
parente37570e139748d180457d85ff858c869242781b3 (diff)
extra safety check for NULL value.
ok joris@
Diffstat (limited to 'usr.bin/cvs/root.c')
-rw-r--r--usr.bin/cvs/root.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c
index 3bf43b2264f..502f773031e 100644
--- a/usr.bin/cvs/root.c
+++ b/usr.bin/cvs/root.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: root.c,v 1.33 2006/06/16 14:07:42 joris Exp $ */
+/* $OpenBSD: root.c,v 1.34 2007/01/18 22:52:23 niallo Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -79,7 +79,7 @@ cvsroot_parse(const char *str)
* at the first position again.
*/
TAILQ_FOREACH(root, &cvs_rcache, root_cache) {
- if (strcmp(str, root->cr_str) == 0) {
+ if (root->cr_str != NULL && strcmp(str, root->cr_str) == 0) {
TAILQ_REMOVE(&cvs_rcache, root, root_cache);
TAILQ_INSERT_HEAD(&cvs_rcache, root, root_cache);
root->cr_ref++;