Repository navigation
Conversation
Author
|
Friendly ping - this adds the missing length check to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the missing length guard to
png_handle_tIME()inpngrutil.c, and remove the deadPNG_UNUSED(length)statement that follows an unconditionalreturn.Problem
Every other fixed-size chunk handler in
pngrutil.cvalidates the chunk length before reading data, for examplepng_handle_tRNS,png_handle_bKGD,png_handle_gAMA:png_handle_tIMEis the only fixed-size handler that skips this check and callspng_crc_read(png_ptr, buf, 7)unconditionally. The dispatch layer (CDtIME 7U, 7U) currently rejects wrong-length chunks before reaching the handler, so there is no direct exploitable path — but relying solely on the dispatch layer for safety is fragile and inconsistent.Additionally,
PNG_UNUSED(length)appears afterreturn handled_okat the end of the function body, making it dead code.Fix
PNG_UNUSED(length)macro invocation.Fixes #826.