summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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