← Commit list

5f0732725

Denys Vlasenko
Denys Vlasenko
2025-04-21
SUCCESS Duration: 157s

Subject

cpio: error out if the file to be achived is >=4GB

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/cpio.c+6 -0
@@ -350,6 +350,12 @@ static NOINLINE int cpio_o(void)
st.st_dev = st.st_rdev = 0;
#endif
+ if (sizeof(st.st_size) > 4
+ && st.st_size > (off_t)0xffffffff
+ ) {
+ bb_error_msg_and_die("error: file '%s' is larger than 4GB", name);
+ }
+
bytes += printf("070701"
"%08X%08X%08X%08X%08X%08X%08X"
"%08X%08X%08X%08X" /* GNU cpio uses uppercase hex */