sevenzip icon indicating copy to clipboard operation
sevenzip copied to clipboard

fix: Prevent panics discovered by fuzzing

Open bodgit opened this issue 2 months ago • 1 comments

A number of uint64 values read from the file are used for sizing slices however really large values will induce a panic which can happen when fuzzing.

For now, check these values are no greater than math.MaxUint32 which is safely within the Golang limit for slices and probably large enough.

Some values also should be greater than zero so add an additional check for that where necessary.

bodgit avatar Oct 16 '25 15:10 bodgit

Coverage Status

coverage: 74.412% (+0.2%) from 74.173% when pulling 0a55860e9c98e87454c4568859de16ca9cf7e814 on fuzz into 0af225b72587dd1a06711ed3674fc8e8b9b4c64c on main.

coveralls avatar Oct 16 '25 15:10 coveralls