]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Client Snap support in cupsd: Additional NULL check
authorTill Kamppeter <till.kamppeter@gmail.com>
Tue, 2 Nov 2021 23:10:03 +0000 (00:10 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Tue, 2 Nov 2021 23:10:03 +0000 (00:10 +0100)
When testing the newest snapd whether it works correctly together
with CUPS, I hit a segfault in the chackwhether the client is a Snap
plugging cups-control, for the case when CUPS is not snapped.

Fixed this with an additional NULL check.

scheduler/auth.c

index 9988a6c55f04ee340215c07ba4ac500192385bf8..9c1167bde33783a77a3fa531a193422aef78b2c8 100644 (file)
@@ -2120,7 +2120,7 @@ check_admin_access(cupsd_client_t *con) // I - Client connection
     cupsdLogClient(con, CUPSD_LOG_DEBUG, "Unable to get client Snap plugs: %s", error->message);
     ret = 0;
   }
-  else if (plugs->len <= 0)
+  else if (!plugs || plugs->len <= 0)
   {
     cupsdLogClient(con, CUPSD_LOG_DEBUG, "Snap without cups-control plug - denied.");
     ret = 0;