python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / archivers / unzip / CVE-2015-7696.diff
blob3aad17bddd780a45e7b7d6623985c86bb2dc3796
1 From 68efed87fabddd450c08f3112f62a73f61d493c9 Mon Sep 17 00:00:00 2001
2 From: Petr Stodulka <pstodulk@redhat.com>
3 Date: Mon, 14 Sep 2015 18:23:17 +0200
4 Subject: [PATCH 1/2] upstream fix for heap overflow
6 https://bugzilla.redhat.com/attachment.cgi?id=1073002
7 ---
8 crypt.c | 12 +++++++++++-
9 1 file changed, 11 insertions(+), 1 deletion(-)
11 diff --git a/crypt.c b/crypt.c
12 index 784e411..a8975f2 100644
13 --- a/crypt.c
14 +++ b/crypt.c
15 @@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
16 GLOBAL(pInfo->encrypted) = FALSE;
17 defer_leftover_input(__G);
18 for (n = 0; n < RAND_HEAD_LEN; n++) {
19 - b = NEXTBYTE;
20 + /* 2012-11-23 SMS. (OUSPG report.)
21 + * Quit early if compressed size < HEAD_LEN. The resulting
22 + * error message ("unable to get password") could be improved,
23 + * but it's better than trying to read nonexistent data, and
24 + * then continuing with a negative G.csize. (See
25 + * fileio.c:readbyte()).
26 + */
27 + if ((b = NEXTBYTE) == (ush)EOF)
28 + {
29 + return PK_ERR;
30 + }
31 h[n] = (uch)b;
32 Trace((stdout, " (%02x)", h[n]));
34 --
35 2.4.6
38 From bd8a743ee0a77e65ad07ef4196c4cd366add3f26 Mon Sep 17 00:00:00 2001
39 From: Kamil Dudka <kdudka@redhat.com>
40 Date: Mon, 14 Sep 2015 18:24:56 +0200
41 Subject: [PATCH 2/2] fix infinite loop when extracting empty bzip2 data
43 ---
44 extract.c | 6 ++++++
45 1 file changed, 6 insertions(+)
47 diff --git a/extract.c b/extract.c
48 index 7134bfe..29db027 100644
49 --- a/extract.c
50 +++ b/extract.c
51 @@ -2733,6 +2733,12 @@ __GDEF
52 int repeated_buf_err;
53 bz_stream bstrm;
55 + if (G.incnt <= 0 && G.csize <= 0L) {
56 + /* avoid an infinite loop */
57 + Trace((stderr, "UZbunzip2() got empty input\n"));
58 + return 2;
59 + }
61 #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
62 if (G.redirect_slide)
63 wsize = G.redirect_size, redirSlide = G.redirect_buffer;
64 --
65 2.4.6