summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/entries.c
diff options
context:
space:
mode:
authorjfb <jfb@openbsd.org>2005-05-19 21:45:45 +0000
committerjfb <jfb@openbsd.org>2005-05-19 21:45:45 +0000
commit19624ea138361049e84666e450363b1201fdc92c (patch)
treedb91689e34957e22608b24505c29a2c06aa05951 /usr.bin/cvs/entries.c
parentLock down SMM space on i82810 MCH and later chips in case BIOS (diff)
downloadwireguard-openbsd-19624ea138361049e84666e450363b1201fdc92c.tar.xz
wireguard-openbsd-19624ea138361049e84666e450363b1201fdc92c.zip
only allocate a revision number if the entry is for a regular file,
and make sure the ce_opts and ce_tag fields point to valid strings even for directories ok joris
Diffstat (limited to 'usr.bin/cvs/entries.c')
-rw-r--r--usr.bin/cvs/entries.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index 8deb047ecae..8a989e8abfe 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.28 2005/05/19 04:17:24 jfb Exp $ */
+/* $OpenBSD: entries.c,v 1.29 2005/05/19 21:45:45 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -350,12 +350,6 @@ cvs_ent_parse(const char *entry)
memset(entp, 0, sizeof(*entp));
entp->ce_buf = buf;
- entp->ce_rev = rcsnum_alloc();
- if (entp->ce_rev == NULL) {
- cvs_ent_free(entp);
- return (NULL);
- }
-
if (*fields[0] == '\0')
entp->ce_type = CVS_ENT_FILE;
else if (*fields[0] == 'D')
@@ -375,17 +369,20 @@ cvs_ent_parse(const char *entry)
if (strcmp(fields[2], "0") == 0)
entp->ce_status = CVS_ENT_ADDED;
}
- rcsnum_aton(sp, NULL, entp->ce_rev);
+ if ((entp->ce_rev = rcsnum_parse(sp)) == NULL) {
+ cvs_ent_free(entp);
+ return (NULL);
+ }
if (strcmp(fields[3], CVS_DATE_DUMMY) == 0)
entp->ce_mtime = CVS_DATE_DMSEC;
else
entp->ce_mtime = cvs_date_parse(fields[3]);
-
- entp->ce_opts = fields[4];
- entp->ce_tag = fields[5];
}
+ entp->ce_opts = fields[4];
+ entp->ce_tag = fields[5];
+
return (entp);
}