From 580b5d18e092bb3e5718b7d901b8c22a88da041f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 28 Oct 2020 12:43:42 -0400 Subject: [PATCH] Fix rastertopwg crash (Apple issue #5773) --- CHANGES-OPENPRINTING.md | 1 + filter/rastertopwg.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES-OPENPRINTING.md b/CHANGES-OPENPRINTING.md index ae46096d49..d9782704c4 100644 --- a/CHANGES-OPENPRINTING.md +++ b/CHANGES-OPENPRINTING.md @@ -32,3 +32,4 @@ Changes in CUPS v2.3.3op1 - Fixed a memory leak in the scheduler (Issue #12) - Fixed a potential integer overflow in the PPD hashing code (Issue #13) - Fixed output-bin and print-quality handling issues (Issue #18) +- Fixed crash in rastertopwg (Apple issue #5773) diff --git a/filter/rastertopwg.c b/filter/rastertopwg.c index 1e63e4ec04..0fa127e29d 100644 --- a/filter/rastertopwg.c +++ b/filter/rastertopwg.c @@ -259,8 +259,7 @@ main(int argc, /* I - Number of command-line args */ } } - if (inheader.cupsPageSizeName[0] && - (pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL) + if (inheader.cupsPageSizeName[0] && (pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL && pwg_size->map.pwg) { strlcpy(outheader.cupsPageSizeName, pwg_size->map.pwg, sizeof(outheader.cupsPageSizeName)); -- 2.47.2