]> git.ipfire.org Git - thirdparty/libarchive.git/commit
warc: consume data once read 1105/head
authorDaniel Axtens <dja@axtens.net>
Tue, 4 Dec 2018 05:33:42 +0000 (16:33 +1100)
committerDaniel Axtens <dja@axtens.net>
Tue, 11 Dec 2018 02:58:11 +0000 (13:58 +1100)
commit9c84b7426660c09c18cc349f6d70b5f8168b5680
tree6aeee318d7d298af4520f243acaf4a9f317ec472
parent15bf44fd2c1ad0e3fd87048b3fcc90c4dcff1175
warc: consume data once read

The warc decoder only used read ahead, it wouldn't actually consume
data that had previously been printed. This means that if you specify
an invalid content length, it will just reprint the same data over
and over and over again until it hits the desired length.

This means that a WARC resource with e.g.
Content-Length: 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666665
but only a few hundred bytes of data, causes a quasi-infinite loop.

Consume data in subsequent calls to _warc_read.

Found with an AFL + afl-rb + qsym setup.
libarchive/archive_read_support_format_warc.c