diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-05-09 19:24:08 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-05-09 19:24:08 +0000 |
commit | 228a7560b4ebceb1584b1d68fe4bc8137ce8352f (patch) | |
tree | b0780e0a16205c125a55586778c521063754e1f3 | |
parent | a881138e0c8b40be75f057a67242dd6d1486a5ad (diff) |
cvs_getln() can fail and return -1.
-rw-r--r-- | usr.bin/cvs/proto.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index b42abc9d9f6..45280c4c8b9 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.49 2005/04/22 15:16:15 joris Exp $ */ +/* $OpenBSD: proto.c,v 1.50 2005/05/09 19:24:07 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -618,7 +618,10 @@ cvs_recvfile(struct cvsroot *root, mode_t *mode) return (NULL); } - cvs_getln(root, buf, sizeof(buf)); + if (cvs_getln(root, buf, sizeof(buf)) < 0) { + cvs_buf_free(fbuf); + return (NULL); + } fsz = (off_t)strtol(buf, &ep, 10); if (*ep != '\0') { |