"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/bled/decompress_unzip.c" between
rufus-3.12.tar.gz and rufus-3.13.tar.gz

About: Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc (for Linux and Windows).

decompress_unzip.c  (rufus-3.12):decompress_unzip.c  (rufus-3.13)
skipping to change at line 171 skipping to change at line 171
#define BAD_CDF_OFFSET ((uint32_t)0xffffffff) #define BAD_CDF_OFFSET ((uint32_t)0xffffffff)
/* NB: does not preserve file position! */ /* NB: does not preserve file position! */
static uint32_t find_cdf_offset(int fd) static uint32_t find_cdf_offset(int fd)
{ {
cde_header_t cde_header; cde_header_t cde_header;
unsigned char *p; unsigned char *p;
off_t end; off_t end;
unsigned char *buf = xzalloc(PEEK_FROM_END); unsigned char *buf = xzalloc(PEEK_FROM_END);
if (buf == NULL)
return 0;
end = lseek(fd, 0, SEEK_END); end = lseek(fd, 0, SEEK_END);
end -= PEEK_FROM_END; end -= PEEK_FROM_END;
if (end < 0) if (end < 0)
end = 0; end = 0;
lseek(fd, end, SEEK_SET); lseek(fd, end, SEEK_SET);
full_read(fd, buf, PEEK_FROM_END); full_read(fd, buf, PEEK_FROM_END);
cde_header.formatted.cdf_offset = BAD_CDF_OFFSET; cde_header.formatted.cdf_offset = BAD_CDF_OFFSET;
p = buf; p = buf;
while (p <= buf + PEEK_FROM_END - CDE_HEADER_LEN - 4) { while (p <= buf + PEEK_FROM_END - CDE_HEADER_LEN - 4) {
skipping to change at line 218 skipping to change at line 220
{ {
off_t org; off_t org;
org = lseek(fd, 0, SEEK_CUR); org = lseek(fd, 0, SEEK_CUR);
if (!cdf_offset) if (!cdf_offset)
cdf_offset = find_cdf_offset(fd); cdf_offset = find_cdf_offset(fd);
if (cdf_offset != BAD_CDF_OFFSET) { if (cdf_offset != BAD_CDF_OFFSET) {
lseek(fd, cdf_offset + 4, SEEK_SET); lseek(fd, cdf_offset + 4, SEEK_SET);
_read(fd, cdf_ptr->raw, CDF_HEADER_LEN); if (_read(fd, cdf_ptr->raw, CDF_HEADER_LEN) != CDF_HEADER_LEN)
return 0;
FIX_ENDIANNESS_CDF(*cdf_ptr); FIX_ENDIANNESS_CDF(*cdf_ptr);
cdf_offset += 4 + CDF_HEADER_LEN cdf_offset += 4 + CDF_HEADER_LEN
+ cdf_ptr->formatted.file_name_length + cdf_ptr->formatted.file_name_length
+ cdf_ptr->formatted.extra_field_length + cdf_ptr->formatted.extra_field_length
+ cdf_ptr->formatted.file_comment_length; + cdf_ptr->formatted.file_comment_length;
} }
lseek(fd, org, SEEK_SET); lseek(fd, org, SEEK_SET);
return cdf_offset; return cdf_offset;
}; };
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)