]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Correct error code in raise in bio_zstd/brotli_flush()
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Fri, 10 Oct 2025 16:58:22 +0000 (00:58 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Oct 2025 17:19:19 +0000 (19:19 +0200)
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28839)

(cherry picked from commit 604d926abb875a88bef80eda4268390a3c7982d0)

crypto/comp/c_brotli.c
crypto/comp/c_zstd.c

index 07e1e76471c5d199c30b200dc22f2d7688498cb9..f873f0a98c70a4f682a8bf9780c79882a759a44b 100644 (file)
@@ -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;
         }
index b4667649f3ce0ce1a425d673b0b22ff4e1bd0c99..a2ad12ad057875909d67b4b01ad967708dfda16a 100644 (file)
@@ -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;
         }