]> 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:17:40 +0000 (19:17 +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)

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

index ab71c2ac60aa95a6dade268a7847580467dfb989..0475297a9aca14efad48f6b6705c4319d4a2d00b 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 840ec7af49323e9b58f325efa1a432eddba8a7c7..a4f82d2c3de8ef8a37161da3d05a701d86c10043 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;
         }