summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/zlib/zlib-1.2.8/CVE-2016-9842.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/zlib/zlib-1.2.8/CVE-2016-9842.patch')
-rw-r--r--meta/recipes-core/zlib/zlib-1.2.8/CVE-2016-9842.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/CVE-2016-9842.patch b/meta/recipes-core/zlib/zlib-1.2.8/CVE-2016-9842.patch
new file mode 100644
index 0000000000..41b8d2a30a
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/CVE-2016-9842.patch
@@ -0,0 +1,35 @@
1commit e54e1299404101a5a9d0cf5e45512b543967f958
2Author: Mark Adler <madler@alumni.caltech.edu>
3Date: Sat Sep 5 17:45:55 2015 -0700
4
5 Avoid shifts of negative values inflateMark().
6
7 The C standard says that bit shifts of negative integers is
8 undefined. This casts to unsigned values to assure a known
9 result.
10
11Upstream-Status: Backport
12http://http.debian.net/debian/pool/main/z/zlib/zlib_1.2.8.dfsg-5.debian.tar.xz
13https://github.com/madler/zlib/commit/e54e1299404101a5a9d0cf5e45512b543967f958
14
15CVE: CVE-2016-9842
16
17Signed-off-by: George McCollister <george.mccollister@gmail.com>
18
19diff --git a/inflate.c b/inflate.c
20index 2889e3a..a718416 100644
21--- a/inflate.c
22+++ b/inflate.c
23@@ -1506,9 +1506,10 @@ z_streamp strm;
24 {
25 struct inflate_state FAR *state;
26
27- if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
28+ if (strm == Z_NULL || strm->state == Z_NULL)
29+ return (long)(((unsigned long)0 - 1) << 16);
30 state = (struct inflate_state FAR *)strm->state;
31- return ((long)(state->back) << 16) +
32+ return (long)(((unsigned long)((long)state->back)) << 16) +
33 (state->mode == COPY ? state->length :
34 (state->mode == MATCH ? state->was - state->length : 0));
35 }