Repository navigation
rastertoescpx: reject a negative or oversized cupsRowFeed - #810
Merged
tillkamppeter merged 1 commit intoNov 20, 2026
Merged
tillkamppeter merged 1 commit into
tillkamppeter merged 1 commit into
Conversation
StartPage() takes DotRowFeed from the page header's cupsRowFeed and only checks it for 0, then uses it to step the subrow that indexes DotBands[128][7] while filling the initial softweave bands. A cupsRowFeed of 0x80000000 or more is negative as an int, so (subrow + DotRowFeed) % modrow goes negative and the band setup reads and writes DotBands[] before the start of the array; a feed close to INT_MAX overflows the same sum. Reject such a feed next to the existing modrow check.
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.
subrow = (subrow + DotRowFeed) % modrowin the initial band fill goes negative and the loop reads and writesDotBands[subrow][plane]before the start of the array. With cupsRowCount 2, cupsRowStep 264 (modrow 128) and cupsRowFeed 0xFFFFFF38, subrow becomes -73 and the band pointers are written about 4 KB before DotBands. A feed close to INT_MAX overflows the same sum.Checked with the band-fill loop from StartPage under ASan/UBSan. Before the fix, cupsRowFeed 0xFFFFFF38 gives a global-buffer-overflow READ and "index -73 out of bounds" on the write. After the fix it is rejected, and feeds 0, 1, 7, 13, 127 and 200 give the same band setup as before.