Skip to content

Commit

Permalink
Fix use-after-free in cupsdAcceptClient() (fixes CVE-2023-34241)
Browse files Browse the repository at this point in the history
Fix use-after-free when logging warnings in case of failures
in `cupsdAcceptClient()` (fixes CVE-2023-34241)
  • Loading branch information
zdohnal committed Jun 22, 2023
1 parent 3f12185 commit 6f6da74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Changes in CUPS v2.4.6 - TBA
----------------------------

- Fix printing multiple files on specific printers (Issue #643)
- Fix use-after-free when logging warnings in case of failures
in `cupsdAcceptClient()` (fixes CVE-2023-34241)


Changes in CUPS v2.4.5 - 2023-06-13
Expand Down
16 changes: 7 additions & 9 deletions scheduler/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
/*
* Can't have an unresolved IP address with double-lookups enabled...
*/

httpClose(con->http);

cupsdLogClient(con, CUPSD_LOG_WARN,
"Name lookup failed - connection from %s closed!",
"Name lookup failed - closing connection from %s!",
httpGetHostname(con->http, NULL, 0));

httpClose(con->http);
free(con);
return;
}
Expand Down Expand Up @@ -235,11 +233,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
* with double-lookups enabled...
*/

httpClose(con->http);

cupsdLogClient(con, CUPSD_LOG_WARN,
"IP lookup failed - connection from %s closed!",
"IP lookup failed - closing connection from %s!",
httpGetHostname(con->http, NULL, 0));

httpClose(con->http);
free(con);
return;
}
Expand All @@ -256,11 +254,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */

if (!hosts_access(&wrap_req))
{
httpClose(con->http);

cupsdLogClient(con, CUPSD_LOG_WARN,
"Connection from %s refused by /etc/hosts.allow and "
"/etc/hosts.deny rules.", httpGetHostname(con->http, NULL, 0));

httpClose(con->http);
free(con);
return;
}
Expand Down

0 comments on commit 6f6da74

Please sign in to comment.