summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-05-19 09:45:42 +0000
committerdes <des@FreeBSD.org>2000-05-19 09:45:42 +0000
commit4721396b1df8b77895c0124ad978ed50298df17a (patch)
treef5daa5581e267b5da7833390443655c8fcb5bb39 /lib/libfetch/http.c
parentb2022bf2c95bb5607e93b7eb49adb01615fc62b7 (diff)
downloadFreeBSD-src-4721396b1df8b77895c0124ad978ed50298df17a.zip
FreeBSD-src-4721396b1df8b77895c0124ad978ed50298df17a.tar.gz
Better handling of some boundary conditions.
Submitted by: ume
Diffstat (limited to 'lib/libfetch/http.c')
-rw-r--r--lib/libfetch/http.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index a395881..a61ef9a 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -135,6 +135,8 @@ _http_fillbuf(struct cookie *c)
} else if (c->encoding == ENC_CHUNKED) {
if (c->chunksize == 0) {
ln = fgetln(c->real_f, &len);
+ if (len <= 2)
+ return NULL;
DEBUG(fprintf(stderr, "\033[1m_http_fillbuf(): new chunk: "
"%*.*s\033[m\n", (int)len-2, (int)len-2, ln));
sscanf(ln, "%x", &(c->chunksize));
OpenPOWER on IntegriCloud