Fix: ppdLutLoad() returning NULL due to undersized spec buffer#72
Merged
tillkamppeter merged 1 commit intoMay 30, 2026
Merged
Conversation
rkt0209
added a commit
to rkt0209/libppd
that referenced
this pull request
May 30, 2026
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.
Problem
ppdLutLoad()inppd/ppd-load-profile.cdeclares itsspec[]buffer asPPD_MAX_NAME(41 bytes), then passes that buffer toppdFindColorAttr(). ButppdFindColorAttr()rejects any caller whose
specsize < IPP_MAX_NAME(256 bytes):As a result, every call to
ppdLutLoad()returns NULL — the function is effectively dead code onmaster. Any printer driver that relies oncups*Dither/cupsAllDitherPPD attributes for halftone LUT loading silently gets no LUT.The sibling functions in the same file (
ppdRGBLoad()at line 193,ppdCMYKLoad()at line 311) already declare theirspec[]buffer asIPP_MAX_NAME, so this is clearly anoversight in
ppdLutLoad()alone.Fix
Change one character — make
ppdLutLoad'sspecbufferIPP_MAX_NAMEto match whatppdFindColorAttr()requires.No API change, no behaviour change for callers that were already getting NULL — they now get the LUT the function was always meant to return.