-
Notifications
You must be signed in to change notification settings - Fork 28
Fix stack-buffer-overflow in ppdCacheCreateWithPPD() #70
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
Merged
tillkamppeter
merged 2 commits into
OpenPrinting:master
from
n0y0nD:fix-stack-buffer-overflow
May 2, 2026
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,243 @@ | ||
| *PPD-Adobe: "4.3" | ||
| *% | ||
| *% Test PPD file #2 for CUPS. | ||
| *% | ||
| *% This file is used to test the CUPS PPD API functions and cannot be | ||
| *% used with any known printers. Look on the CUPS web site for working PPD | ||
| *% files. | ||
| *% | ||
| *% If you are a PPD file developer, consider using the PPD compiler (ppdc) | ||
| *% to create your PPD files - not only will it save you time, it produces | ||
| *% consistently high-quality files. | ||
| *% | ||
| *% Copyright (c) 2007-2018 by Apple Inc. | ||
| *% Copyright (c) 2002-2006 by Easy Software Products. | ||
| *% | ||
| *% Licensed under Apache License v2.0. See the file "LICENSE" for more | ||
| *% information. | ||
| *FormatVersion: "4.3" | ||
| *FileVersion: "2.3" | ||
| *LanguageVersion: English | ||
| *LanguageEncoding: ISOLatin1 | ||
| *PCFileName: "TEST.PPD" | ||
| *Manufacturer: "Apple" | ||
| *Product: "(Test2)" | ||
| *cupsVersion: 2.3 | ||
| *ModelName: "Test2" | ||
| *ShortNickName: "Test2" | ||
| *NickName: "Test2 for CUPS" | ||
| *PSVersion: "(3010.000) 0" | ||
| *LanguageLevel: "3" | ||
| *ColorDevice: True | ||
| *DefaultColorSpace: RGB | ||
| *FileSystem: False | ||
| *Throughput: "1" | ||
| *LandscapeOrientation: Plus90 | ||
| *TTRasterizer: Type42 | ||
|
|
||
| *% These constraints are used to test ppdConflicts() and cupsResolveConflicts() | ||
| *cupsUIConstraints envelope: "*PageSize Letter *InputSlot Envelope" | ||
| *cupsUIConstraints envelope: "*PageSizeß¾ËßÕ¶‘Š‹¬“‹ßº‘‰š“šÝõÕœŠŒª¶šŒ“‰šßš‘‰š“šÅßÝÕ¶‘Š‹¬“‹ß²anual *PageSize Env10" | ||
|
|
||
| *cupsUIConstraints envphoto: "*PageSize Env10 *InputSlot Envelope *Quality Photo" | ||
| *cupsUIResolver envphoto: "*Quality Normal" | ||
|
|
||
| *% This constraint is used to test ppdInstallableConflict() | ||
| *cupsUIConstraints: "*Duplex *InstalledDuplexer False" | ||
|
|
||
| *% These constraints are used to test the loop detection code in cupsResolveConflicts() | ||
| *cupsUIConstraints loop1: "*PageSize A4 *Quality Photo" | ||
| *cupsUIResolver loop1: "*Quality Normal" | ||
| *cupsUIConstraints loop2: "*PageSize A4 *Quality Normal" | ||
| *cupsUIResolver loop2: "*Quality Photo" | ||
|
|
||
| *% For PageSize, we have put all of the translations in-line... | ||
| *OpenUI *PageSize/Page Size: PickOne | ||
| *fr.Translation PageSize/French Page Size: "" | ||
| *fr_CA.Translation PageSize/French Canadian Page Size: "" | ||
| *OrderDependency: 10 AnySetup *PageSize | ||
| *DefaultPageSize: Letter | ||
| *PageSize Letter/US Letter: "PageSize=Letter" | ||
| *fr.PageSize Letter/French US Letter: "" | ||
| *fr_CA.PageSize Letter/French Canadian US Letter: "" | ||
| *PageSize A4/A4: "PageSize=A4" | ||
| *fr.PageSize A4/French A4: "" | ||
| *fr_CA.PageSize A4/French Canadian A4: "" | ||
| *PageSize Env10/#10 Envelope: "PageSize=Env10" | ||
| *fr.PageSize Env10/French #10 Envelope: "" | ||
| *fr_CA.PageSize Env10/French Canadian #10 Envelope: "" | ||
| *CloseUI: *PageSize | ||
|
|
||
| *% For PageRegion, we have separated the translations... | ||
| *OpenUI *PageRegion/Page Region: PickOne | ||
| *OrderDependency: 10 AnySetup *PageRegion | ||
| *DefaultPageRegion: Letter | ||
| *PageRegion Letter/US Letter: "PageRegion=Letter" | ||
| *PageRegion A4/A4: "PageRegion=A4" | ||
| *PageRegion Env10/#10 Envelope: "PageRegion=Env10" | ||
| *CloseUI: *PageRegion | ||
|
|
||
| *fr.Translation PageRegion/French Page Region: "" | ||
| *fr.PageRegion Letter/French US Letter: "" | ||
| *fr.PageRegion A4/French A4: "" | ||
| *fr.PageRegion Env10/French #10 Envelope: "" | ||
|
|
||
| *fr_CA.Translation PageRegion/French Canadian Page Region: "" | ||
| *fr_CA.PageRegion Letter/French Canadian US Letter: "" | ||
| *fr_CA.PageRegion A4/French Canadian A4: "" | ||
| *fr_CA.PageRegion Env10/French Canadian #10 Envelope: "" | ||
|
|
||
| *DefaultImageableArea: Letter | ||
| *ImageableArea Letter: "18 36 594 756" | ||
| *ImageableArea A4: "18 36 577 806" | ||
| *ImageableArea Env10: "18 36 279 648" | ||
|
|
||
| *DefaultPaperDimension: Letter | ||
| *PaperDimension Letter: "612 792" | ||
| *PaperDimension A4: "595 842" | ||
| *PaperDimension Env10: "297 684" | ||
|
|
||
| *% Custom page size support | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you here tell with a comment that we use invalid/out-of-range maximum paper dimensions to trigger the bug? |
||
| *HWMargins: 0 0 0 0 | ||
| *NonUIOrderDependency: 100 AnySetup *CustomPageSize True | ||
| *CustomPageSize True/Custom Page Size: "PageSize=Custom" | ||
| *ParamCustomPageSize Width: 1 points 36 1E80 | ||
| *ParamCustomPageSize Height: 2 points 36 86400 | ||
| *ParamCustomPageSize WidthOffset/Width Offset: 3 points 0 0 | ||
| *ParamCustomPageSize HeightOffset/Height Offset: 4 points 0 0 | ||
| *ParamCustomPageSize Orientation: 5 int 0 0 | ||
|
|
||
| *cupsMediaQualifier2: InputSlot | ||
| *cupsMediaQualifier3: Quality | ||
| *cupsMaxSize .Manual.: "1000 1000" | ||
| *cupsMinSize .Manual.: "100 100" | ||
| *cupsMinSize .Manual.Photo: "200 200" | ||
| *cupsMinSize ..Photo: "300 300" | ||
|
|
||
| *OpenUI *InputSlot/Input Slot: PickOne | ||
| *OrderDependency: 20 AnySetup *InputSlot | ||
| *DefaultInputSlot: Tray | ||
| *InputSlot Tray/Tray: "InputSlot=Tray" | ||
| *InputSlot Manual/Manual Feed: "InputSlot=Manual" | ||
| *InputSlot Envelope/Envelope Feed: "InputSlot=Envelope" | ||
| *CloseUI: *InputSlot | ||
|
|
||
| *OpenUI *Quality/Output Mode: PickOne | ||
| *OrderDependency: 20 AnySetup *Quality | ||
| *DefaultQuality: Normal | ||
| *Quality Draft: "Quality=Draft" | ||
| *Quality Normal: "Quality=Normal" | ||
| *Quality Photo: "Quality=Photo" | ||
| *CloseUI: *Quality | ||
|
|
||
| *OpenUI *Duplex/2-Sided Printing: PickOne | ||
| *OrderDependency: 10 DocumentSetup *Duplex | ||
| *DefaultDuplex: None | ||
| *Duplex None/Off: "Duplex=None" | ||
| *Duplex DuplexNoTumble/Long Edge: "Duplex=DuplexNoTumble" | ||
| *Duplex DuplexTumble/Short Edge: "Duplex=DuplexTumble" | ||
| *CloseUI: *Duplex | ||
|
|
||
| *% Installable option... | ||
| *OpenGroup: InstallableOptions/Installable Options | ||
| *OpenUI InstalledDuplexer/Duplexer Installed: Boolean | ||
| *DefaultInstalledDuplexer: False | ||
| *InstalledDuplexer False: "" | ||
| *InstalledDuplexer True: "" | ||
| *CloseUI: *InstalledDuplexer | ||
| *CloseGroup: InstallableOptions | ||
|
|
||
| *% Custom options... | ||
| *OpenGroup: Extended/Extended Options | ||
|
|
||
| *OpenUI IntOption/Integer: PickOne | ||
| *OrderDependency: 30 AnySetup *IntOption | ||
| *DefaultIntOption: None | ||
| *IntOption None: "" | ||
| *IntOption 1: "IntOption=1" | ||
| *IntOption 2: "IntOption=2" | ||
| *IntOption 3: "IntOption=3" | ||
| *CloseUI: *IntOption | ||
|
|
||
| *CustomIntOption True/Custom Integer: "IntOption=Custom" | ||
| *ParamCustomIntOption Integer: 1 int -100 100 | ||
|
|
||
| *OpenUI StringOption/String: PickOne | ||
| *OrderDependency: 40 AnySetup *StringOption | ||
| *DefaultStringOption: None | ||
| *StringOption None: "" | ||
| *StringOption foo: "StringOption=foo" | ||
| *StringOption bar: "StringOption=bar" | ||
| *CloseUI: *StringOption | ||
|
|
||
| *CustomStringOption True/Custom String: "StringOption=Custom" | ||
| *ParamCustomStringOption String: 1 string 1 10 | ||
|
|
||
| *CloseGroup: Extended | ||
|
|
||
| *% IPP reasons for ppdLocalizeIPPReason tests | ||
| *cupsIPPReason foo/Foo Reason: "http://foo/bar.html | ||
| help:anchor='foo'%20bookID=Vendor%20Help | ||
| /help/foo/bar.html" | ||
| *End | ||
| *fr.cupsIPPReason foo/La Foo Reason: "text:La%20Long%20 | ||
| text:Foo%20Reason | ||
| http://foo/fr/bar.html | ||
| help:anchor='foo'%20bookID=Vendor%20Help | ||
| /help/fr/foo/bar.html" | ||
| *End | ||
| *zh_TW.cupsIPPReason foo/Number 1 Foo Reason: "text:Number%201%20 | ||
| text:Foo%20Reason | ||
| http://foo/zh_TW/bar.html | ||
| help:anchor='foo'%20bookID=Vendor%20Help | ||
| /help/zh_TW/foo/bar.html" | ||
| *End | ||
| *zh.cupsIPPReason foo/Number 2 Foo Reason: "text:Number%202%20 | ||
| text:Foo%20Reason | ||
| http://foo/zh/bar.html | ||
| help:anchor='foo'%20bookID=Vendor%20Help | ||
| /help/zh/foo/bar.html" | ||
| *End | ||
|
|
||
| *% Marker names for ppdLocalizeMarkerName tests | ||
| *cupsMarkerName cyan/Cyan Toner: "" | ||
| *fr.cupsMarkerName cyan/La Toner Cyan: "" | ||
| *zh_TW.cupsMarkerName cyan/Number 1 Cyan Toner: "" | ||
| *zh.cupsMarkerName cyan/Number 2 Cyan Toner: "" | ||
|
|
||
| *DefaultFont: Courier | ||
| *Font AvantGarde-Book: Standard "(001.006S)" Standard ROM | ||
| *Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM | ||
| *Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM | ||
| *Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM | ||
| *Font Bookman-Demi: Standard "(001.004S)" Standard ROM | ||
| *Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM | ||
| *Font Bookman-Light: Standard "(001.004S)" Standard ROM | ||
| *Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM | ||
| *Font Courier: Standard "(002.004S)" Standard ROM | ||
| *Font Courier-Bold: Standard "(002.004S)" Standard ROM | ||
| *Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM | ||
| *Font Courier-Oblique: Standard "(002.004S)" Standard ROM | ||
| *Font Helvetica: Standard "(001.006S)" Standard ROM | ||
| *Font Helvetica-Bold: Standard "(001.007S)" Standard ROM | ||
| *Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM | ||
| *Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM | ||
| *Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM | ||
| *Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM | ||
| *Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM | ||
| *Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM | ||
| *Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM | ||
| *Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM | ||
| *Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM | ||
| *Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM | ||
| *Font Palatino-Bold: Standard "(001.005S)" Standard ROM | ||
| *Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM | ||
| *Font Palatino-Italic: Standard "(001.005S)" Standard ROM | ||
| *Font Palatino-Roman: Standard "(001.005S)" Standard ROM | ||
| *Font Symbol: Special "(001.007S)" Special ROM | ||
| *Font Times-Bold: Standard "(001.007S)" Standard ROM | ||
| *Font Times-BoldItalic: Standard "(001.009S)" Standard ROM | ||
| *Font Times-Italic: Standard "(001.007S)" Standard ROM | ||
| *Font Times-Roman: Standard "(001.007S)" Standard ROM | ||
| *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM | ||
| *Font ZapfDingbats: Special "(001.004S)" Standard ROM | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that this messy line is not a trigger for this bug (the invalid/out-of-range maximum custom page size dimensions are). So could you edit this line to be something readable? Or just delete this line?