From f9e0b5ab5cf1f807c7f09a734bc3adeb43ecb381 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sat, 11 Oct 2025 00:58:22 +0800 Subject: [PATCH] Correct error code in raise in bio_zstd/brotli_flush() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Joshua Rogers Reviewed-by: Matt Caswell Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28839) (cherry picked from commit 604d926abb875a88bef80eda4268390a3c7982d0) --- crypto/comp/c_brotli.c | 2 +- crypto/comp/c_zstd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/comp/c_brotli.c b/crypto/comp/c_brotli.c index ab71c2ac60a..0475297a9ac 100644 --- a/crypto/comp/c_brotli.c +++ b/crypto/comp/c_brotli.c @@ -685,7 +685,7 @@ static int bio_brotli_flush(BIO *b) brret = BrotliEncoderCompressStream(ctx->encode.state, BROTLI_OPERATION_FINISH, &ctx->encode.avail_in, (const uint8_t**)&ctx->encode.next_in, &ctx->encode.avail_out, &ctx->encode.next_out, NULL); if (brret != BROTLI_TRUE) { - ERR_raise(ERR_LIB_COMP, COMP_R_BROTLI_DECODE_ERROR); + ERR_raise(ERR_LIB_COMP, COMP_R_BROTLI_ENCODE_ERROR); ERR_add_error_data(1, "brotli encoder error"); return 0; } diff --git a/crypto/comp/c_zstd.c b/crypto/comp/c_zstd.c index 840ec7af493..a4f82d2c3de 100644 --- a/crypto/comp/c_zstd.c +++ b/crypto/comp/c_zstd.c @@ -732,7 +732,7 @@ static int bio_zstd_flush(BIO *b) /* Compress some more */ zret = ZSTD_flushStream(ctx->compress.state, &ctx->compress.outbuf); if (ZSTD_isError(zret)) { - ERR_raise(ERR_LIB_COMP, COMP_R_ZSTD_DECODE_ERROR); + ERR_raise(ERR_LIB_COMP, COMP_R_ZSTD_COMPRESS_ERROR); ERR_add_error_data(1, ZSTD_getErrorName(zret)); return 0; } -- 2.47.3