]> 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:30:52 +0000 (15:30 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Mon, 9 Apr 2018 19:30:52 +0000 (15:30 -0400)
CHANGES.md
scheduler/ipp.c

index c09d583aedae73d30e38b2427fd2bdb9d848b602..b96bab55e01cd85214cc19c143c6e3dac6346f65 100644 (file)
@@ -12,6 +12,8 @@ Changes in CUPS v2.2.8
 - Fixed builds without PAM (Issue #5283)
 - 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.2.7
index b4f7910022dddc9d1693bf642212253850302b42..5811311d41fbb86e8ad2d6cf87d1548b85a01f42 100644 (file)
@@ -5360,6 +5360,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));
 
@@ -5369,6 +5371,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));