From: Michael R Sweet Date: Mon, 27 Jan 2025 19:59:18 +0000 (-0500) Subject: Fix an edge case in cupsGetResponse so we don't accidentally write a 0-length chunk. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e106bcd6a17b51c2e5ef14145a1ba9b73b1b605c;p=thirdparty%2Fcups.git Fix an edge case in cupsGetResponse so we don't accidentally write a 0-length chunk. --- diff --git a/cups/request.c b/cups/request.c index 0312aebe85..ab2c43fea1 100644 --- a/cups/request.c +++ b/cups/request.c @@ -378,7 +378,7 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP * Check for an unfinished chunked request... */ - if (http->data_encoding == HTTP_ENCODING_CHUNKED) + if (http->state == HTTP_STATE_POST_RECV && http->data_encoding == HTTP_ENCODING_CHUNKED) { /* * Send a 0-length chunk to finish off the request...