From bb525305608a74394b60dc58fbd80233c1316a1e Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 21 Feb 2019 11:13:20 -0500 Subject: [PATCH] The lpadmin command would hang with a bad PPD file (rdar://41495016) --- CHANGES.md | 1 + systemv/lpadmin.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 97e062b7f0..020e4de4f3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ CHANGES - 2.3b8 - 2019-02-21 Changes in CUPS v2.3b8 ---------------------- +- The lpadmin command would hang with a bad PPD file (rdar://41495016) - Fixed a potential crash bug in cups-driverd (rdar://46625579) - Fixed a performance regression with large PPDs (rdar://47040759) - The `ippValidateAttribute` function did not catch all instances of invalid diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c index 53580ff4e3..f428368d4d 100644 --- a/systemv/lpadmin.c +++ b/systemv/lpadmin.c @@ -1431,6 +1431,7 @@ set_printer_options( /* Status code */ _cupsLangPrintf(stderr, _("lpadmin: Unable to open PPD \"%s\": %s on line %d."), ppdfile, ppdErrorString(status), linenum); + return (1); } ppdMarkDefaults(ppd); @@ -1449,9 +1450,7 @@ set_printer_options( if ((in = cupsFileOpen(ppdfile, "r")) == NULL) { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to open PPD file \"%s\" - %s"), - ppdfile, strerror(errno)); + _cupsLangPrintf(stderr, _("lpadmin: Unable to open PPD \"%s\": %s"), ppdfile, strerror(errno)); ippDelete(request); if (ppdfile != file) unlink(ppdfile); -- 2.47.2