diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-08-16 16:34:20 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-08-16 16:34:20 +0000 |
commit | c54b4d6980b5d5a0a66e819ef0c0b8df82eee4a1 (patch) | |
tree | 7c3919cb4584f1da39809cee21fe66faa469b5b7 /usr.bin | |
parent | 8b36809a520b18156d0b2fdbaebf123e7b11f2c6 (diff) |
#define CVS_ENT_MAXLINELEN 1024
.. as the maximum length of a line in an Entries file, and use it.
problem spotted a while ago by mpech@.
ok jfb joris
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/cvs.h | 4 | ||||
-rw-r--r-- | usr.bin/cvs/entries.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/resp.c | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index 5507c93f181..0d16dbc8080 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.79 2005/08/12 14:41:54 xsa Exp $ */ +/* $OpenBSD: cvs.h,v 1.80 2005/08/16 16:34:19 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -244,6 +244,8 @@ struct cvsroot { #define CVS_ENT_REMOVED 2 #define CVS_ENT_UPTODATE 3 +#define CVS_ENT_MAXLINELEN 1024 + #define CVS_ENTF_SYNC 0x01 /* contents of disk and memory match */ #define CVS_ENTF_WR 0x02 /* file is opened for writing too */ diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index c014774aca6..b139b80b16d 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.44 2005/08/12 18:46:53 xsa Exp $ */ +/* $OpenBSD: entries.c,v 1.45 2005/08/16 16:34:19 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -53,7 +53,8 @@ cvs_ent_open(const char *dir, int flags) { size_t len; int exists, nodir; - char cdpath[MAXPATHLEN], entpath[MAXPATHLEN], ebuf[128], mode[4]; + char cdpath[MAXPATHLEN], ebuf[CVS_ENT_MAXLINELEN], entpath[MAXPATHLEN]; + char mode[4]; FILE *fp; struct stat st; struct cvs_ent *ent; diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index 36f2c6ea67a..39fc6c4a217 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.54 2005/08/14 23:24:55 joris Exp $ */ +/* $OpenBSD: resp.c,v 1.55 2005/08/16 16:34:19 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -508,7 +508,7 @@ cvs_resp_createdir(char *line) static int cvs_resp_newentry(struct cvsroot *root, int type, char *line) { - char entbuf[128]; + char entbuf[CVS_ENT_MAXLINELEN]; struct cvs_ent *ent; /* get the remote path */ |