| 235 | } |
| 236 | |
| 237 | static void write_zip_data_desc(unsigned long size, |
| 238 | unsigned long compressed_size, |
| 239 | unsigned long crc) |
| 240 | { |
| 241 | if (size >= 0xffffffff || compressed_size >= 0xffffffff) { |
| 242 | struct zip64_data_desc trailer; |
| 243 | copy_le32(trailer.magic, 0x08074b50); |
| 244 | copy_le32(trailer.crc32, crc); |
| 245 | copy_le64(trailer.compressed_size, compressed_size); |
| 246 | copy_le64(trailer.size, size); |
| 247 | write_or_die(1, &trailer, ZIP64_DATA_DESC_SIZE); |
| 248 | zip_offset += ZIP64_DATA_DESC_SIZE; |
| 249 | } else { |
| 250 | struct zip_data_desc trailer; |
| 251 | copy_le32(trailer.magic, 0x08074b50); |
| 252 | copy_le32(trailer.crc32, crc); |
| 253 | copy_le32(trailer.compressed_size, compressed_size); |
| 254 | copy_le32(trailer.size, size); |
| 255 | write_or_die(1, &trailer, ZIP_DATA_DESC_SIZE); |
| 256 | zip_offset += ZIP_DATA_DESC_SIZE; |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | static void set_zip_header_data_desc(struct zip_local_header *header, |
| 261 | unsigned long size, |
no test coverage detected