-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bugs, compiler warnings and add tests #32
Conversation
Add test from fuzzing samples in image-rs#28, image-rs#29 and image-rs#31
Thanks for fixing these so quickly! This has unblocked further fuzzing which found at least one more panic: #33 |
@HeroicKatora I have fixed the possibly overflowing multiplication and changed the limits to |
@HeroicKatora @Robzz @bvssvni friendly ping. Would it be possible to look at this so that we can eventually release a new version of the library with the newly merged PRs? |
Just now realized that during converting to |
This PR adds a
Limits
struct to fix the memory exhaustion bug in #29, this changes the public API slightly, becauseifd::Entry::val
now also needs aLimits
parameter. It adds some array bounds checking for indices that directly come from the tiff file. While I was at it I also fixed #13 by changingDecoder::read_string
to return aTiffResult
instead of aFromUtf8Error
result. I also fixed some smaller compiler and clippy warnings.I added the samples from #28, #29 and #31 as new tests, thank you @Shnatsel!
This will fix #13, fix #28, fix #29, fix #30 and fix #31.
@Robzz and @HeroicKatora what do you think of this?