From 926c7cb675881b9254e9aba4ba448dd7735f99e2 Mon Sep 17 00:00:00 2001 From: tanjiro Kamado Date: Wed, 7 Oct 2026 12:45:06 +0530 Subject: [PATCH] count httpPeek output bytes from the copied zlib stream --- CHANGES.md | 1 + cups/http.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a6917b1f1..2cb75d1a5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,7 @@ v3.0.4 - YYYY-MM-DD - Updated `ippeveprinter` to add a date/time stamp when logging to a file. - Now explicitly validate IPP attribute names as keyword strings. - Fixed `httpGetDateString` with bad date/time values (Issue #167) +- Fixed the number of bytes reported by `httpPeek` for content-encoded data. - Fixed a potential buffer overflow in `cupsDNSSDAssembleFullName` on Windows (Issue #170) - Fixed a potential string overrun when loading .strings files (Issue #171) diff --git a/cups/http.c b/cups/http.c index 079dafd3a..7b774515a 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1687,7 +1687,7 @@ httpPeek(http_t *http, // I - HTTP connection return (-1); } - bytes = (ssize_t)(length - ((z_stream *)http->stream)->avail_out); + bytes = (ssize_t)(length - stream.avail_out); } else if (http->used > 0) {