From cdb45d71b2857d2a9d96bbfd4b2af02ed66cb85a Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Tue, 3 Jun 2025 21:57:42 +0200 Subject: [PATCH] warc: Ignore separator when reaching end of entry When _warc_read encounters end of entry, it adds 4 bytes to the last offset for \r\n\r\n separator, which is never written. Ignore these bytes since they are not part of the returned entry. Signed-off-by: Tobias Stoeckmann --- libarchive/archive_read_support_format_warc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c index 696f959c3..d8f188cf0 100644 --- a/libarchive/archive_read_support_format_warc.c +++ b/libarchive/archive_read_support_format_warc.c @@ -405,7 +405,7 @@ _warc_read(struct archive_read *a, const void **buf, size_t *bsz, int64_t *off) /* it's our lucky day, no work, we can leave early */ *buf = NULL; *bsz = 0U; - *off = w->cntoff + 4U/*for \r\n\r\n separator*/; + *off = w->cntoff; w->unconsumed = 0U; return (ARCHIVE_EOF); } -- 2.47.3