]> git.pld-linux.org Git - packages/openssl.git/blob - openssl-zlib-fix.patch
- updated to 1.1.1d (fixes CVE-2019-1547 CVE-2019-1549 CVE-2019-1563)
[packages/openssl.git] / openssl-zlib-fix.patch
1 From 4245d63be73402df5917bbd099178ba56c136e13 Mon Sep 17 00:00:00 2001
2 From: Tomas Mraz <tmraz@fedoraproject.org>
3 Date: Thu, 12 Sep 2019 12:27:36 +0200
4 Subject: [PATCH] BIO_f_zlib: Properly handle BIO_CTRL_PENDING and
5  BIO_CTRL_WPENDING calls.
6
7 There can be data to write in output buffer and data to read that were
8 not yet read in the input stream.
9
10 Fixes #9866
11 ---
12  crypto/comp/c_zlib.c | 25 +++++++++++++++++++++++++
13  1 file changed, 25 insertions(+)
14
15 diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
16 index 78219f202d8..3d2c142f004 100644
17 --- a/crypto/comp/c_zlib.c
18 +++ b/crypto/comp/c_zlib.c
19 @@ -546,6 +546,7 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
20      int ret, *ip;
21      int ibs, obs;
22      BIO *next = BIO_next(b);
23 +    z_stream *zin;
24  
25      if (next == NULL)
26          return 0;
27 @@ -598,6 +599,30 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
28          BIO_copy_next_retry(b);
29          break;
30  
31 +    case BIO_CTRL_WPENDING:
32 +        if (ctx->obuf == NULL)
33 +            return 0;
34 +
35 +        if (ctx->odone) {
36 +            ret = ctx->ocount;
37 +        }
38 +        else {
39 +            ret = ctx->ocount;
40 +            if (ret == 0)
41 +                /* Unknown amount pending but we are not finished */
42 +                ret = 1;
43 +        }
44 +        if (ret == 0)
45 +            ret = BIO_ctrl(next, cmd, num, ptr);
46 +        break;
47 +
48 +    case BIO_CTRL_PENDING:
49 +        zin = &ctx->zin;
50 +        ret = zin->avail_in;
51 +        if (ret == 0)
52 +            ret = BIO_ctrl(next, cmd, num, ptr);
53 +        break;
54 +
55      default:
56          ret = BIO_ctrl(next, cmd, num, ptr);
57          break;
This page took 0.029036 seconds and 3 git commands to generate.