From c516e5e387bb4697ac6072ec3ca600ead93a3da1 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Wed, 10 Jun 2026 18:28:44 -0400
Subject: [PATCH] Make sure we have room for another space (Issue #1607)

---
 CHANGES.md          | 1 +
 cups/raster-error.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

#diff --git a/CHANGES.md b/CHANGES.md
#index 1601fa4aa..02382ea89 100644
#--- a/CHANGES.md
#+++ b/CHANGES.md
#@@ -13,6 +13,7 @@ Changes in CUPS v2.4.20 (YYYY-MM-DD)
#   related to CVE-2026-34980)
# - Fixed handling of Kerberos user@REALM identities for user validation and
#   quotas when StripUserDomain is not enabled (Issue #1584)
#+- Fixed raster error reporting overflow (Issue #1607)
# - Fixed several issues reported by Coverity
# 
# 
--- a/cups/raster-error.c
+++ b/cups/raster-error.c
@@ -46,7 +46,7 @@ _cupsRasterAddError(const char *f,	/* I
   if ((size_t)bytes >= sizeof(s))
     return;
 
-  if (bytes > (ssize_t)(buf->end - buf->current))
+  if ((bytes + 1) > (ssize_t)(buf->end - buf->current))
   {
    /*
     * Allocate more memory...
