]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Update changelog and make sure we have the len==0 check for cupsRasterReadPixels...
authorMichael R Sweet <msweet@msweet.org>
Mon, 25 Mar 2024 19:07:53 +0000 (15:07 -0400)
committerMichael R Sweet <msweet@msweet.org>
Mon, 25 Mar 2024 19:07:53 +0000 (15:07 -0400)
CHANGES.md
cups/raster-stream.c

index 59c508ce87dc2ec77d5e486a7fc688ec4c406896..1ae376fd494947ec99f24ca07c5229282e7c1389 100644 (file)
@@ -23,6 +23,8 @@ Changes in CUPS v2.5b1 (TBA)
   (Issue #751)
 - Updated `httpAddrConnect2()` to handle `POLLHUP` together with `POLLIN` or
   `POLLOUT` (Issue #839)
+- Updated `cupsRasterReadPixels` and `cupsRasterWritePixels` to not try reading
+  or writing if the number of bytes passed is 0 (Issue #914)
 - Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error
   handling (fixes CVE-2023-34241)
 - Fixed hanging of `lpstat` on Solaris (Issue #156)
index f130670097b7a6df8591071eadaf1b0617713c8a..643943aa57bff62de595cd1626e07951c09897d8 100644 (file)
@@ -1038,7 +1038,7 @@ _cupsRasterReadPixels(
   DEBUG_printf("_cupsRasterReadPixels(r=%p, p=%p, len=%u)", (void *)r, (void *)p, len);
 
   if (r == NULL || r->mode != CUPS_RASTER_READ || r->remaining == 0 ||
-      r->header.cupsBytesPerLine == 0)
+      r->header.cupsBytesPerLine == 0 || len == 0)
   {
     DEBUG_puts("1_cupsRasterReadPixels: Returning 0.");
     return (0);