From 0d59551c9515e1dafea2af84a77246f06f8b50c3 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Tue, 21 Aug 2018 14:01:20 +0800 Subject: php: fix CVE-2017-9120 Signed-off-by: Changqing Li Signed-off-by: Khem Raj --- .../recipes-devtools/php/php/CVE-2017-9120.patch | 21 +++++++++++++++++++++ meta-oe/recipes-devtools/php/php_7.2.8.bb | 1 + 2 files changed, 22 insertions(+) create mode 100644 meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch (limited to 'meta-oe') diff --git a/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch b/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch new file mode 100644 index 0000000000..728f25bb6e --- /dev/null +++ b/meta-oe/recipes-devtools/php/php/CVE-2017-9120.patch @@ -0,0 +1,21 @@ +php: patch for CVE-2017-9120 + +Upstream-Status: Backport [https://bugs.php.net/bug.php?id=74544] + +CVE: CVE-2017-9120 + +Signed-off-by: Changqing Li + +diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c +index 03a39d7..7b88731 100644 +--- a/ext/mysqli/mysqli_api.c ++++ b/ext/mysqli/mysqli_api.c +@@ -1965,7 +1965,7 @@ PHP_FUNCTION(mysqli_real_escape_string) { + } + MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); + +- newstr = zend_string_alloc(2 * escapestr_len, 0); ++ newstr = zend_string_safe_alloc(2, escapestr_len, 0, 0); + ZSTR_LEN(newstr) = mysql_real_escape_string(mysql->mysql, ZSTR_VAL(newstr), escapestr, escapestr_len); + newstr = zend_string_truncate(newstr, ZSTR_LEN(newstr), 0); + diff --git a/meta-oe/recipes-devtools/php/php_7.2.8.bb b/meta-oe/recipes-devtools/php/php_7.2.8.bb index e8cb7fd34b..2a7937ed69 100644 --- a/meta-oe/recipes-devtools/php/php_7.2.8.bb +++ b/meta-oe/recipes-devtools/php/php_7.2.8.bb @@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=67e369bc8d1f2e641236b8002039a6a2" SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \ file://0001-acinclude.m4-skip-binconfig-check-for-libxml.patch \ file://0001-fix-error-caused-by-a-new-variable-is-declared-after.patch \ + file://CVE-2017-9120.patch \ " SRC_URI_append_class-target = " \ file://pear-makefile.patch \ -- cgit 1.2.3-korg