diff --git a/lib/fetch/http.c b/lib/fetch/http.c index 27577878..4be31c46 100644 --- a/lib/fetch/http.c +++ b/lib/fetch/http.c @@ -284,6 +284,8 @@ http_readfn(void *v, void *buf, size_t len) if (!io->buf || io->bufpos == io->buflen) if (http_fillbuf(io, len) < 1) break; + if (!io->buf) + return -1; l = io->buflen - io->bufpos; if (len < l) l = len;