summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-09-12 10:31:59 +0200
committerRemi Collet <remi@remirepo.net>2017-09-12 10:31:59 +0200
commit6518fb698394e71407c14e99102ea4ce6df1d664 (patch)
tree89f6c1c91d0da12bc8d47d043c02396f13aa078e
parent0fd0943e1c752bafc7ca85c6009bbccc2a30697a (diff)
test build for https://github.com/php/php-src/pull/2750
-rw-r--r--2750.patch51
-rw-r--r--php.spec7
2 files changed, 57 insertions, 1 deletions
diff --git a/2750.patch b/2750.patch
new file mode 100644
index 0000000..6eb4e0f
--- /dev/null
+++ b/2750.patch
@@ -0,0 +1,51 @@
+From 8b55da74170b0c8686d2f2fa3d4e858f7785b6a2 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 12 Sep 2017 09:16:24 +0200
+Subject: [PATCH] Fixed bug #75193 segfault in
+ collator_convert_object_to_string
+
+---
+ ext/intl/collator/collator_sort.c | 8 ++++++--
+ ext/intl/tests/bug75193.phpt | 14 ++++++++++++++
+ 2 files changed, 20 insertions(+), 2 deletions(-)
+ create mode 100644 ext/intl/tests/bug75193.phpt
+
+diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
+index 1ad42d3660f0..7e7bde671f6b 100644
+--- a/ext/intl/collator/collator_sort.c
++++ b/ext/intl/collator/collator_sort.c
+@@ -59,8 +59,12 @@ static int collator_regular_compare_function(zval *result, zval *op1, zval *op2)
+ zval norm1, norm2;
+ zval *num1_p = NULL, *num2_p = NULL;
+ zval *norm1_p = NULL, *norm2_p = NULL;
+- zval* str1_p = collator_convert_object_to_string( op1, &str1 );
+- zval* str2_p = collator_convert_object_to_string( op2, &str2 );
++ zval *str1_p, *str2_p;
++
++ ZVAL_NULL(&str1);
++ str1_p = collator_convert_object_to_string( op1, &str1 );
++ ZVAL_NULL(&str2);
++ str2_p = collator_convert_object_to_string( op2, &str2 );
+
+ /* If both args are strings AND either of args is not numeric string
+ * then use ICU-compare. Otherwise PHP-compare. */
+diff --git a/ext/intl/tests/bug75193.phpt b/ext/intl/tests/bug75193.phpt
+new file mode 100644
+index 000000000000..d6c32dbe260a
+--- /dev/null
++++ b/ext/intl/tests/bug75193.phpt
+@@ -0,0 +1,14 @@
++--TEST--
++Bug #75193 segfault in collator_convert_object_to_string
++--SKIPIF--
++<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
++--FILE--
++<?php
++$a = new \Collator('en_US');
++$b = [new stdclass, new stdclass];
++var_dump($a->sort($b));
++?>
++===DONE===
++--EXPECT--
++bool(true)
++===DONE===
diff --git a/php.spec b/php.spec
index 50d6a75..ad479f8 100644
--- a/php.spec
+++ b/php.spec
@@ -126,7 +126,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: %{?scl_prefix}php
Version: %{upver}%{?rcver:~%{rcver}}
-Release: 2%{?dist}
+Release: 3%{?dist}
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
@@ -192,6 +192,7 @@ Patch300: php-7.0.10-datetests.patch
Patch301: php-7.0.0-oldpcre.patch
# WIP
+Patch400: 2750.patch
BuildRequires: bzip2-devel, curl-devel >= 7.9, %{db_devel}
BuildRequires: httpd-devel >= 2.0.46-1, pam-devel
@@ -903,6 +904,7 @@ fi
%endif
# WIP patch
+%patch400 -p1 -b .75193
# Prevent %%doc confusion over LICENSE files
cp Zend/LICENSE Zend/ZEND_LICENSE
@@ -1808,6 +1810,9 @@ fi
%changelog
+* Tue Sep 12 2017 Remi Collet <remi@fedoraproject.org> - 7.1.9-3
+- test build for https://github.com/php/php-src/pull/2750
+
* Thu Aug 31 2017 Remi Collet <remi@fedoraproject.org> - 7.1.9-2
- add patch for EL-6, fix undefined symbol: sqlite3_errstr