]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler: Fix possible use_after_free in `cupsdReadClient()` 1454/head
authorZdenek Dohnal <zdohnal@redhat.com>
Thu, 11 Dec 2025 14:12:55 +0000 (15:12 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Thu, 11 Dec 2025 14:12:55 +0000 (15:12 +0100)
If `cupsdSendHeader()` fails, we free the connection and return -1, but
in that case we try to free the connection again in `cupsdReadClient()`.

scheduler/client.c

index f6166091e8df2e97cb6aea4e03d1a51e1c39743e..63844d531874eaf7b88ecd12172c542954f39c15 100644 (file)
@@ -2761,10 +2761,7 @@ check_start_tls(cupsd_client_t *con)     /* I - Client connection */
     httpSetField(con->http, HTTP_FIELD_CONTENT_LENGTH, "0");
 
     if (!cupsdSendHeader(con, HTTP_STATUS_OK, NULL, CUPSD_AUTH_NONE))
-    {
-      cupsdCloseClient(con);
       return (-1);
-    }
   }
 
   return (1);