mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-26 09:27:36 +01:00
- prevented crash when probing for a zip file which size is less than the mazimum size of end of central directory registry.
This commit is contained in:
parent
360aa448d3
commit
e2736ef3ef
@ -138,7 +138,9 @@
|
|||||||
(if (>= file-size +eocd-fixed-size+)
|
(if (>= file-size +eocd-fixed-size+)
|
||||||
(with-open-zip-file (stream path)
|
(with-open-zip-file (stream path)
|
||||||
(let ((buffer (make-array +max-eocd-total-size+ :element-type +byte-type+)))
|
(let ((buffer (make-array +max-eocd-total-size+ :element-type +byte-type+)))
|
||||||
(file-position stream (- file-size +max-eocd-total-size+))
|
(file-position stream (- file-size
|
||||||
|
(min +max-eocd-total-size+
|
||||||
|
file-size)))
|
||||||
(read-sequence buffer stream)
|
(read-sequence buffer stream)
|
||||||
(loop named signature-finder
|
(loop named signature-finder
|
||||||
for eocd-position
|
for eocd-position
|
||||||
|
Loading…
x
Reference in New Issue
Block a user