summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-01-20 19:53:12 +0000
committerdes <des@FreeBSD.org>2002-01-20 19:53:12 +0000
commit69f2f16cb42c89819e0ee868b0ec3154642c7d71 (patch)
tree7fd2d667cd3951b9da20dd5facc59edf5d1ea3a2 /lib/libfetch/http.c
parent9f6167dc5a9010eb2cb906a6d661c6e76abb3c08 (diff)
downloadFreeBSD-src-69f2f16cb42c89819e0ee868b0ec3154642c7d71.zip
FreeBSD-src-69f2f16cb42c89819e0ee868b0ec3154642c7d71.tar.gz
Check the return value from read() when reading the CR/LF at the end of a
chunk. PR: bin/33608 MFC after: 2 weeks
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 6158968..04b7964 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -195,8 +195,10 @@ _http_fillbuf(struct cookie *c)
c->chunksize -= c->b_len;
if (c->chunksize == 0) {
- char endl[2];
- read(c->fd, endl, 2);
+ char endl;
+ if (read(c->fd, &endl, 1) == -1 ||
+ read(c->fd, &endl, 1) == -1)
+ return -1;
}
c->b_pos = 0;
OpenPOWER on IntegriCloud