From 6d97ee39fedf12a7a5429a74f4156ef9bb67f562 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Wed, 22 Apr 2026 12:40:14 +0200
Subject: [PATCH] Fix cupsd crash if user does not exist on server

---
 CHANGES.md       | 6 ++++++
 scheduler/auth.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

#diff --git a/CHANGES.md b/CHANGES.md
#index 52e41acf9..795a9b644 100644
#--- a/CHANGES.md
#+++ b/CHANGES.md
#@@ -2,6 +2,12 @@ CHANGES - OpenPrinting CUPS
# ===========================
# 
# 
#+Changes in CUPS v2.4.18 (2026-04-22)
#+------------------------------------
#+
#+- Fixed cupsd crash if user does not exist (Issue #1555)
#+
#+
# Changes in CUPS v2.4.17 (2026-04-17)
# ------------------------------------
# 
diff --git a/scheduler/auth.c b/scheduler/auth.c
index 3e7041e22..d5f564e0f 100644
--- a/scheduler/auth.c
+++ b/scheduler/auth.c
@@ -1835,7 +1835,7 @@ cupsdIsAuthorized(cupsd_client_t *con,	/* I - Connection */
 	 name;
 	 name = (char *)cupsArrayNext(best->names))
     {
-      if (!_cups_strcasecmp(name, "@OWNER") && owner &&
+      if (!_cups_strcasecmp(name, "@OWNER") && owner && pw &&
           !strcmp(pw->pw_name, ownername))
 	return (HTTP_OK);
       else if (!_cups_strcasecmp(name, "@SYSTEM"))
