X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=jcc.c;h=12e7736499d5b034afc6cd7be3e82709c79e73b0;hb=78619a0f9d61b2e4bbf9b940f1a92bd09981ced6;hp=bb6a8fa40c523f032f918edfe44b772e4bdc22d6;hpb=5eed38e5ebda7acea64bff72bc77a298398c9ecd;p=privoxy.git diff --git a/jcc.c b/jcc.c index bb6a8fa4..12e77364 100644 --- a/jcc.c +++ b/jcc.c @@ -1503,6 +1503,12 @@ static enum chunk_status chunked_body_is_complete(struct iob *iob, size_t *lengt /* Move beyond the chunkdata. */ p += 2 + chunksize; + /* Make sure we're still within the buffer and have two bytes left */ + if (p + 2 > iob->eod) + { + return CHUNK_STATUS_MISSING_DATA; + } + /* There should be another "\r\n" to skip */ if (memcmp(p, "\r\n", 2)) {