1 parent d56d0b9 commit a625923Copy full SHA for a625923
1 file changed
src/inflate.mbt
@@ -71,6 +71,13 @@ fn inflt(
71
if btype == 0 {
72
// stored block
73
let s = shft(pos) + 4
74
+ // Check if we have enough bytes for the stored block header (4 bytes)
75
+ if s > dat_end {
76
+ if no_st != 0 {
77
+ raise fzip_err(UnexpectedEOF)
78
+ }
79
+ break
80
81
let l = dat[s - 4].to_int() | (dat[s - 3].to_int() << 8)
82
let t = s + l
83
if t > dat_end {
0 commit comments