summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python/CVE-2016-5636.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python/CVE-2016-5636.patch')
-rw-r--r--meta/recipes-devtools/python/python/CVE-2016-5636.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python/CVE-2016-5636.patch b/meta/recipes-devtools/python/python/CVE-2016-5636.patch
new file mode 100644
index 0000000000..5906153d31
--- /dev/null
+++ b/meta/recipes-devtools/python/python/CVE-2016-5636.patch
@@ -0,0 +1,42 @@
1
2# HG changeset patch
3# User Benjamin Peterson <benjamin@python.org>
4# Date 1453357424 28800
5# Node ID 985fc64c60d6adffd1138b6cc46df388ca91ca5d
6# Parent 7ec954b9fc54448a35b56d271340ba109eb381b9
7prevent buffer overflow in get_data (closes #26171)
8
9Upstream-Status: Backport
10CVE: CVE-2016-5636
11Signed-off-by: Armin Kuster <akuster@mvista.com>
12
13Index: Python-2.7.9/Misc/NEWS
14===================================================================
15--- Python-2.7.9.orig/Misc/NEWS
16+++ Python-2.7.9/Misc/NEWS
17@@ -7,6 +7,9 @@ What's New in Python 2.7.9?
18
19 *Release date: 2014-12-10*
20
21+- Issue #26171: Fix possible integer overflow and heap corruption in
22+ zipimporter.get_data().
23+
24 Library
25 -------
26
27Index: Python-2.7.9/Modules/zipimport.c
28===================================================================
29--- Python-2.7.9.orig/Modules/zipimport.c
30+++ Python-2.7.9/Modules/zipimport.c
31@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_en
32 PyMarshal_ReadShortFromFile(fp); /* local header size */
33 file_offset += l; /* Start of file data */
34
35+ if (data_size > LONG_MAX - 1) {
36+ fclose(fp);
37+ PyErr_NoMemory();
38+ return NULL;
39+ }
40 raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
41 data_size : data_size + 1);
42 if (raw_data == NULL) {