summaryrefslogtreecommitdiff
path: root/debian/patches/CVE-2016-9842.diff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-05-13 13:54:49 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-05-13 13:54:49 +0300
commit42156b5190f4fa150e1fab6777eb81e69d4db8c9 (patch)
tree3bf47de81cf1f89892789535a036d2d55d93a136 /debian/patches/CVE-2016-9842.diff
downloadgcc-6-debian.tar.gz
Imported gcc-6 (6.3.0-17)debian/6.3.0-17debian
Diffstat (limited to 'debian/patches/CVE-2016-9842.diff')
-rw-r--r--debian/patches/CVE-2016-9842.diff27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/patches/CVE-2016-9842.diff b/debian/patches/CVE-2016-9842.diff
new file mode 100644
index 0000000..0858168
--- /dev/null
+++ b/debian/patches/CVE-2016-9842.diff
@@ -0,0 +1,27 @@
+commit e54e1299404101a5a9d0cf5e45512b543967f958
+Author: Mark Adler <madler@alumni.caltech.edu>
+Date: Sat Sep 5 17:45:55 2015 -0700
+
+ Avoid shifts of negative values inflateMark().
+
+ The C standard says that bit shifts of negative integers is
+ undefined. This casts to unsigned values to assure a known
+ result.
+
+Index: b/src/zlib/inflate.c
+===================================================================
+--- a/src/zlib/inflate.c
++++ b/src/zlib/inflate.c
+@@ -1504,9 +1504,10 @@ z_streamp strm;
+ {
+ struct inflate_state FAR *state;
+
+- if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
++ if (strm == Z_NULL || strm->state == Z_NULL)
++ return (long)(((unsigned long)0 - 1) << 16);
+ state = (struct inflate_state FAR *)strm->state;
+- return ((long)(state->back) << 16) +
++ return (long)(((unsigned long)((long)state->back)) << 16) +
+ (state->mode == COPY ? state->length :
+ (state->mode == MATCH ? state->was - state->length : 0));
+ }