mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
rechecked the merged libzip, took also the indents from the original to
avoid confusion next time
This commit is contained in:
parent
a39bcfc5ee
commit
f4a44f18b8
6 changed files with 18 additions and 28 deletions
|
@ -357,17 +357,17 @@ _zip_check_torrentzip(struct zip *za)
|
|||
if (za->cdir->comment_len != TORRENT_SIG_LEN+8
|
||||
|| strncmp(za->cdir->comment, TORRENT_SIG, TORRENT_SIG_LEN) != 0)
|
||||
return;
|
||||
|
||||
|
||||
memcpy(buf, za->cdir->comment+TORRENT_SIG_LEN, 8);
|
||||
buf[8] = '\0';
|
||||
errno = 0;
|
||||
crc_should = strtoul(buf, &end, 16);
|
||||
if ((crc_should == UINT_MAX && errno != 0) || (end && *end))
|
||||
return;
|
||||
|
||||
|
||||
if (_zip_filerange_crc(za->zp, za->cdir->offset, za->cdir->size,
|
||||
&crc_got, NULL) < 0)
|
||||
return;
|
||||
return;
|
||||
|
||||
if (crc_got == crc_should)
|
||||
za->flags |= ZIP_AFL_TORRENT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue