]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix another CUPS-Create-Local-Printer crash (Issue #5290)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 9 Apr 2018 19:31:56 +0000 (15:31 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 9 Apr 2018 19:31:56 +0000 (15:31 -0400)
CHANGES.md
scheduler/ipp.c

index bd4692a20ce7e18424f1e026fdff780caf9260a3..03517e0336dd445b70c7f81f9f17cb61143fd7d4 100644 (file)
@@ -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
index 2396c9b58ed88bce4c5659e7559c861d48b80342..5c0d35e0b54ce512828754a08a83d56762b2cf82 100644 (file)
@@ -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));