Describe the bug
When decompressing a gzipped file of ~5KB the length and checksum verifications fail.
Reproduction Steps
module main
import compress.gzip
import os
fn main () {
compressed := os.read_bytes ('in.xml.gz' )!
println (compressed[0 ..100 ])
decoded := gzip.decompress (compressed)!
println (decoded.bytestr ())
}
Expected Behavior
No errors
Current Behavior
V panic: result not set (length verification failed, got 4548, expected 3289448448)
Possible Solution
The decompression algorithm is correct, because when I remove the length and checksum check I can see that result is correct.
The following code seems to be overflowing/underflowing
(u32 (data[data.len - 4 ]) << 24 ) | (u32 (data[data.len - 3 ]) << 16 ) | (u32 (data[data.len - 2 ]) << 8 ) | data[data.len - 1 ]
gzip.v
Additional Information/Context
No response
V version
0.4.2
Environment details (OS name and version, etc.)
V full version: V 0.4.2 25777bd .ad935ca
OS: Linux
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Describe the bug
When decompressing a gzipped file of ~5KB the length and checksum verifications fail.
Reproduction Steps
Expected Behavior
No errors
Current Behavior
Possible Solution
The decompression algorithm is correct, because when I remove the length and checksum check I can see that result is correct.
The following code seems to be overflowing/underflowing
gzip.v
Additional Information/Context
No response
V version
0.4.2
Environment details (OS name and version, etc.)
V full version: V 0.4.2 25777bd.ad935ca
OS: Linux
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.