rubyzip 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +9 -0
- data/lib/zip/central_directory.rb +39 -33
- data/lib/zip/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67852d915e2ec168efb617d7577ac60196bf7433b3c2800981a14c5a43b939c5
|
|
4
|
+
data.tar.gz: '039b39e7e9e7f46e056da4d0070554eba081e26a4dd99e3dd47d76428628d29f'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba24363c26265acbd295289685d5baa4d351a913d98de67064171c35f0055f04ac34b2e6db384af248e124b12abc505bac558205eadb2975d3d4da59178b9a54
|
|
7
|
+
data.tar.gz: b654167d21076c70ea58b6a185f4be83a6ef172d208bf4f8a8928ac82aa909773b20df462870dc833b1182f669334e18fd7283e23cf4040b770faea1a49d1e6a
|
data/Changelog.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# 3.2.2 (2025-11-02)
|
|
2
|
+
|
|
3
|
+
- Fix reading EOCDs when header signatures are in an Entry payload. [#656](https://github.com/rubyzip/rubyzip/issues/656)
|
|
4
|
+
|
|
5
|
+
Tooling/internal:
|
|
6
|
+
|
|
7
|
+
- Stop using macos-13 runners in GitHub Actions.
|
|
8
|
+
- Update YJIT GitHub Actions runners.
|
|
9
|
+
|
|
1
10
|
# 3.2.1 (2025-10-24)
|
|
2
11
|
|
|
3
12
|
- Fix `Entry#gather_fileinfo_from_srcpath` error messages. [#654](https://github.com/rubyzip/rubyzip/issues/654)
|
|
@@ -143,28 +143,27 @@ module Zip
|
|
|
143
143
|
zip64_eocd_offset
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
# Unpack the EOCD and return a boolean indicating whether this header is
|
|
147
|
+
# complete without needing Zip64 extensions.
|
|
148
|
+
def unpack_e_o_c_d(buffer) # :nodoc: # rubocop:disable Naming/PredicateMethod
|
|
147
149
|
_, # END_OF_CD_SIG. We know we have this at this point.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
size_in_bytes,
|
|
153
|
-
cdir_offset,
|
|
150
|
+
@number_of_this_disk,
|
|
151
|
+
@number_of_disk_with_start_of_cdir,
|
|
152
|
+
@total_number_of_entries_in_cdir_on_this_disk,
|
|
153
|
+
@size,
|
|
154
|
+
@size_in_bytes,
|
|
155
|
+
@cdir_offset,
|
|
154
156
|
comment_length = buffer.unpack('VvvvvVVv')
|
|
155
157
|
|
|
156
|
-
@number_of_this_disk = num_disk unless num_disk == 0xFFFF
|
|
157
|
-
@number_of_disk_with_start_of_cdir = num_disk_cdir unless num_disk_cdir == 0xFFFF
|
|
158
|
-
@total_number_of_entries_in_cdir_on_this_disk = num_cdir_disk unless num_cdir_disk == 0xFFFF
|
|
159
|
-
@size = num_entries unless num_entries == 0xFFFF
|
|
160
|
-
@size_in_bytes = size_in_bytes unless size_in_bytes == 0xFFFFFFFF
|
|
161
|
-
@cdir_offset = cdir_offset unless cdir_offset == 0xFFFFFFFF
|
|
162
|
-
|
|
163
158
|
@comment = if comment_length.positive?
|
|
164
159
|
buffer.slice(STATIC_EOCD_SIZE, comment_length)
|
|
165
160
|
else
|
|
166
161
|
''
|
|
167
162
|
end
|
|
163
|
+
|
|
164
|
+
!([@number_of_this_disk, @number_of_disk_with_start_of_cdir,
|
|
165
|
+
@total_number_of_entries_in_cdir_on_this_disk, @size].any?(0xFFFF) ||
|
|
166
|
+
@size_in_bytes == 0xFFFFFFFF || @cdir_offset == 0xFFFFFFFF)
|
|
168
167
|
end
|
|
169
168
|
|
|
170
169
|
def read_central_directory_entries(io) # :nodoc:
|
|
@@ -217,30 +216,37 @@ module Zip
|
|
|
217
216
|
eocd_location = data.rindex([END_OF_CD_SIG].pack('V'))
|
|
218
217
|
raise Error, 'Zip end of central directory signature not found' unless eocd_location
|
|
219
218
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if zip64_eocd_locator
|
|
223
|
-
zip64_eocd_location = data.rindex([ZIP64_END_OF_CD_SIG].pack('V'))
|
|
219
|
+
# Parse the EOCD and return if it is complete without Zip64 extensions.
|
|
220
|
+
return if unpack_e_o_c_d(data.slice(eocd_location..-1))
|
|
224
221
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
data.slice(zip64_eocd_locator..eocd_location)
|
|
231
|
-
)
|
|
232
|
-
unless zip64_eocd_location
|
|
233
|
-
raise Error, 'Zip64 end of central directory signature not found'
|
|
234
|
-
end
|
|
222
|
+
# Need to read in the Zip64 EOCD locator and then the Zip64 EOCD.
|
|
223
|
+
zip64_eocd_locator = data.rindex([ZIP64_EOCD_LOCATOR_SIG].pack('V'), eocd_location)
|
|
224
|
+
unless zip64_eocd_locator
|
|
225
|
+
raise Error, 'Zip64 end of central directory locator signature expected but not found'
|
|
226
|
+
end
|
|
235
227
|
|
|
236
|
-
|
|
237
|
-
|
|
228
|
+
# Do we already have the Zip64 EOCD in the data we've read?
|
|
229
|
+
zip64_eocd_location = data.rindex([ZIP64_END_OF_CD_SIG].pack('V'), zip64_eocd_locator)
|
|
230
|
+
|
|
231
|
+
zip64_eocd_data =
|
|
232
|
+
if zip64_eocd_location
|
|
233
|
+
# Yes.
|
|
234
|
+
data.slice(zip64_eocd_location..zip64_eocd_locator)
|
|
235
|
+
else
|
|
236
|
+
# No. Read its location from the locator and then read it in.
|
|
237
|
+
zip64_eocd_location = unpack_64_eocd_locator(
|
|
238
|
+
data.slice(zip64_eocd_locator..eocd_location)
|
|
239
|
+
)
|
|
240
|
+
unless zip64_eocd_location
|
|
241
|
+
raise Error, 'Zip64 end of central directory signature not found'
|
|
238
242
|
end
|
|
239
243
|
|
|
240
|
-
|
|
241
|
-
|
|
244
|
+
io.seek(zip64_eocd_location, IO::SEEK_SET)
|
|
245
|
+
io.read(base_location + zip64_eocd_locator - zip64_eocd_location)
|
|
246
|
+
end
|
|
242
247
|
|
|
243
|
-
|
|
248
|
+
# Finally, unpack the Zip64 EOCD.
|
|
249
|
+
unpack_64_e_o_c_d(zip64_eocd_data)
|
|
244
250
|
end
|
|
245
251
|
|
|
246
252
|
def eocd_data(io)
|
data/lib/zip/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyzip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Haines
|
|
@@ -195,9 +195,9 @@ licenses:
|
|
|
195
195
|
- BSD-2-Clause
|
|
196
196
|
metadata:
|
|
197
197
|
bug_tracker_uri: https://github.com/rubyzip/rubyzip/issues
|
|
198
|
-
changelog_uri: https://github.com/rubyzip/rubyzip/blob/v3.2.
|
|
199
|
-
documentation_uri: https://www.rubydoc.info/gems/rubyzip/3.2.
|
|
200
|
-
source_code_uri: https://github.com/rubyzip/rubyzip/tree/v3.2.
|
|
198
|
+
changelog_uri: https://github.com/rubyzip/rubyzip/blob/v3.2.2/Changelog.md
|
|
199
|
+
documentation_uri: https://www.rubydoc.info/gems/rubyzip/3.2.2
|
|
200
|
+
source_code_uri: https://github.com/rubyzip/rubyzip/tree/v3.2.2
|
|
201
201
|
wiki_uri: https://github.com/rubyzip/rubyzip/wiki
|
|
202
202
|
rubygems_mfa_required: 'true'
|
|
203
203
|
rdoc_options: []
|