From: Michael R Sweet Date: Mon, 9 Apr 2018 19:31:56 +0000 (-0400) Subject: Fix another CUPS-Create-Local-Printer crash (Issue #5290) X-Git-Tag: v2.3b5~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=656c109a1ca4009bf0a59c9f28b4fbe78d80ea79;p=thirdparty%2Fcups.git Fix another CUPS-Create-Local-Printer crash (Issue #5290) --- diff --git a/CHANGES.md b/CHANGES.md index bd4692a20c..03517e0336 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,8 @@ Changes in CUPS v2.3rc1 in list or CSV mode (Issue #5278) - The `cupsCreateJob`, `cupsPrintFile2`, and `cupsPrintFiles2` APIs did not use the supplied HTTP connection (Issue #5288) +- Fixed another crash in the scheduler when adding an IPP Everywhere printer + (Issue #5290) Changes in CUPS v2.3b4 diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 2396c9b58e..5c0d35e0b5 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -5335,6 +5335,8 @@ create_local_bg_thread( if (_ppdCreateFromIPP(fromppd, sizeof(fromppd), response)) { + _cupsRWLockWrite(&printer->lock); + if ((!printer->info || !*(printer->info)) && (attr = ippFindAttribute(response, "printer-info", IPP_TAG_TEXT)) != NULL) cupsdSetString(&printer->info, ippGetString(attr, 0, NULL)); @@ -5344,6 +5346,8 @@ create_local_bg_thread( if ((!printer->geo_location || !*(printer->geo_location)) && (attr = ippFindAttribute(response, "printer-geo-location", IPP_TAG_URI)) != NULL) cupsdSetString(&printer->geo_location, ippGetString(attr, 0, NULL)); + _cupsRWUnlock(&printer->lock); + if ((from = cupsFileOpen(fromppd, "r")) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, "%s: Unable to read generated PPD: %s", printer->name, strerror(errno));