<div dir="auto"><div dir="auto"><br></div><div dir="auto">Hello,</div><div dir="auto"><br></div><div dir="auto">I'm using the latest version of busybox (1.31.0).</div><div dir="auto">I found an issue when using "dpkg" and "dpkg-deb" in busybox.</div><div dir="auto">When I performed some task to get the control info of a ".deb" file.</div><div dir="auto">The output showed a "dpkg-deb: corrupted data" message.</div><div dir="auto"><br></div><div dir="auto">e.g.</div><div dir="auto">```</div><div dir="auto"># dpkg-deb -f <some_deb_file></div><div dir="auto">Package: <some_package></div><div dir="auto">...</div><div dir="auto">dpkg-deb: corrupted data</div><div dir="auto">```</div><div dir="auto"><br></div><div dir="auto">I looked into the source code.</div><div dir="auto">In file "archival/libarchive/decompress_unxz.c" line 97, here busybox tried to decompress another xz stream when it found that the input stream isn't ended.</div><div dir="auto"><br></div><div dir="auto">So the issue happens on newer Debian package files.</div><div dir="auto">Newer Debian package files format is an "ar" archive of 3 files including "debian-binary", "control.tar.xz", "data.tar.xz" in orders.</div><div dir="auto">When performing tasks on the Debian package file, the archive handler open the ".deb" file as the input stream.</div><div dir="auto">When busybox complete reading the section of "control.tar.xz", it automatically tried to decompress another xz stream because there is still the section of "data.tar.xz" in the input stream.</div><div dir="auto">In this situation, busybox will read the label of "ar" archive for "data.tar.xz" section. Then it fails at checking xz's header magic. And finally a "corrupted data" error message is printed.</div><div dir="auto"><br></div><div dir="auto">---</div><div dir="auto"><br></div><div dir="auto">The issue can be easily reproduced by any Debian package file in Debian 10. For example, "busybox_1.30.1-4_amd64.deb".</div><div dir="auto"><br></div><div dir="auto">In my case, I can just applied a patch to disable the decompression of another xz stream.</div><div dir="auto">Because I don't think I need such a feature for my "xz" utility.</div><div dir="auto"><br></div><div dir="auto">But I still wondered if there is a better solution of this issue.</div><div dir="auto">If you have any suggestion, please let me know.</div><div dir="auto">Thank you very much.</div><div dir="auto"><br></div><div dir="auto">Ken</div></div>