← Commit list

894fa0ad6

Denys Vlasenko
Denys Vlasenko
2010-06-26
FAILED Duration: 39s

Subject

fix breakage in compressed file detection

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/rpm2cpio.c+2 -2
@@ -75,7 +75,7 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
} magic;
IF_DESKTOP(long long) int FAST_FUNC (*unpack)(int src_fd, int dst_fd);
- xread(rpm_fd, magic.b16, sizeof(magic.b16));
+ xread(rpm_fd, magic.b16, sizeof(magic.b16[0]));
if (magic.b16[0] == GZIP_MAGIC) {
unpack = unpack_gz_stream;
} else
@@ -89,7 +89,7 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
) {
/* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */
/* More info at: http://tukaani.org/xz/xz-file-format.txt */
- xread(rpm_fd, magic.b32, sizeof(magic.b32));
+ xread(rpm_fd, magic.b32, sizeof(magic.b32[0]));
if (magic.b32[0] != XZ_MAGIC2)
goto no_magic;
/* unpack_xz_stream wants fd at position 0 */
libbb/read_printf.c+2 -2
@@ -265,7 +265,7 @@ void FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/)
/* .gz and .bz2 both have 2-byte signature, and their
* unpack_XXX_stream wants this header skipped. */
- xread(fd, magic.b16, sizeof(magic.b16));
+ xread(fd, magic.b16, sizeof(magic.b16[0]));
if (ENABLE_FEATURE_SEAMLESS_GZ
&& magic.b16[0] == GZIP_MAGIC
) {
@@ -292,7 +292,7 @@ void FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/)
/* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */
/* More info at: http://tukaani.org/xz/xz-file-format.txt */
offset = -6;
- xread(fd, magic.b32, sizeof(magic.b32));
+ xread(fd, magic.b32, sizeof(magic.b32[0]));
if (magic.b32[0] == XZ_MAGIC2) {
# if BB_MMU
xformer = unpack_xz_stream;