diff options
author | 2005-05-09 19:24:07 +0000 | |
---|---|---|
committer | 2005-05-09 19:24:07 +0000 | |
commit | 14bfd1d796ad59e06a6f4132665dd93cfeecfe57 (patch) | |
tree | 9adb7de9150bb990432b044d8df8ea8938550836 | |
parent | Compile if no wsmouse device is configured in the kernel. (diff) | |
download | wireguard-openbsd-14bfd1d796ad59e06a6f4132665dd93cfeecfe57.tar.xz wireguard-openbsd-14bfd1d796ad59e06a6f4132665dd93cfeecfe57.zip |
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') { |