Article View: linux.debian.bugs.dist
Article #2769Bug#1152654: zip format fails when reading from stdin
From: Johannes Schauer Marin Rodrigues
Date: Sat, 31 Oct 2026 00:40
Date: Sat, 31 Oct 2026 00:40
65 lines
3450 bytes
3450 bytes
Package: libarchive13t64
Version: 3.8.10-2
Severity: normal
Tags: upstream
Control: forwarded -1 https://github.com/libarchive/libarchive/issues/3780
Hi,
this is a bug upstream knows about. I'm filing it here so that I can reference
it in the workaround I will upload for genext2fs until this bug is fixed in
libarchive. Reproducer:
--%<-------------------------------------------------------
#include <archive.h>
#include <archive_entry.h>
int main() {
struct archive_entry *entry;
struct archive *a;
int r;
a = archive_read_new();
if (a == NULL) {
fprintf(stderr, "archive_read_new() failed\n");
return 1;
}
if (archive_read_support_format_tar(a) != ARCHIVE_OK) {
fprintf(stderr, "archive_read_support_format_tar() failed\n");
return 1;
}
if (archive_read_support_format_zip(a) != ARCHIVE_OK) {
fprintf(stderr, "archive_read_support_format_zip() failed\n");
return 1;
}
r = archive_read_open_FILE(a, stdin);
if (r) {
fprintf(stderr, "archive_read_open_FILE() failed\n");
return 1;
}
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF) {
fprintf(stderr, "ARCHIVE_EOF -- success!\n");
return 0;
}
if (r != ARCHIVE_OK) {
fprintf(stderr, "archive_read_next_header() failed: %s\n",
archive_error_string(a));
return 1;
}
return 0;
}
-->%-------------------------------------------------------
$ dd if=/dev/zero bs=10240 count=1 status=none | ./a.out
archive_read_next_header() failed: Truncated tar archive detected while reading next header
The above will work if archive_read_support_format_zip is commented out, so
in genext2fs I will just limit the input formats to tar to work around this
issue.
More details in the referenced upstream issue.
Thanks!
cheers, josch
Technical Details
Message-ID:
<NU5ix-8Un9-13@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod From: Johannes Schauer Marin Rodrigues <josch@debian.org> Newsgroups: linux.debian.bugs.dist Subject: Bug#1152654: zip format fails when reading from stdin Date: Sat, 31 Oct 2026 01:40:01 +0100 Message-ID: <NU5ix-8Un9-13@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Sat Oct 31 00:39:08 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.7 Reply-To: Johannes Schauer Marin Rodrigues <josch@debian.org>, 1152654@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: gabriel.barrantes.dev@outlook.com X-Debian-Pr-Message: report 1152654 X-Debian-Pr-Package: libarchive13t64 X-Debian-Pr-Keywords: upstream X-Debian-Pr-Source: libarchive Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: reportbug 13.2.0+nmu1 X-Debian-User: josch X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1999853 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 65 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sat, 31 Oct 2026 01:37:49 +0100 X-Original-Message-ID: <179340706936.3501420.9123748688387984349.reportbug@localhost>