summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--9d15f07adb0de7ae02111f942bf7d0957bbc25d0.patch50
-rw-r--r--php-pecl-redis.spec9
2 files changed, 58 insertions, 1 deletions
diff --git a/9d15f07adb0de7ae02111f942bf7d0957bbc25d0.patch b/9d15f07adb0de7ae02111f942bf7d0957bbc25d0.patch
new file mode 100644
index 0000000..4093968
--- /dev/null
+++ b/9d15f07adb0de7ae02111f942bf7d0957bbc25d0.patch
@@ -0,0 +1,50 @@
+From 9d15f07adb0de7ae02111f942bf7d0957bbc25d0 Mon Sep 17 00:00:00 2001
+From: Pavlo Yatsukhnenko <yatsukhnenko@gmail.com>
+Date: Fri, 20 Oct 2017 16:37:11 +0300
+Subject: [PATCH] Issue #1224
+
+---
+ redis.c | 2 ++
+ redis_array.c | 2 ++
+ redis_cluster.c | 2 ++
+ 3 files changed, 6 insertions(+)
+
+diff --git a/redis.c b/redis.c
+index ff83159f..18e7ef90 100644
+--- a/redis.c
++++ b/redis.c
+@@ -547,6 +547,8 @@ create_redis_object(zend_class_entry *ce TSRMLS_DC)
+ zval *tmp;
+ zend_hash_copy(redis->std.properties, &ce->default_properties,
+ (copy_ctor_func_t)zval_add_ref, (void *)&tmp, sizeof(zval *));
++#else
++ object_properties_init(&redis->std, ce);
+ #endif
+
+ retval.handle = zend_objects_store_put(redis,
+diff --git a/redis_array.c b/redis_array.c
+index b293253f..01a48e5f 100644
+--- a/redis_array.c
++++ b/redis_array.c
+@@ -187,6 +187,8 @@ create_redis_array_object(zend_class_entry *ce TSRMLS_DC)
+ zval *tmp;
+ zend_hash_copy(obj->std.properties, &ce->default_properties,
+ (copy_ctor_func_t)zval_add_ref, (void *)&tmp, sizeof(zval *));
++#else
++ object_properties_init(&obj->std, ce);
+ #endif
+
+ retval.handle = zend_objects_store_put(obj,
+diff --git a/redis_cluster.c b/redis_cluster.c
+index 94b0077c..f1136471 100644
+--- a/redis_cluster.c
++++ b/redis_cluster.c
+@@ -332,6 +332,8 @@ create_cluster_context(zend_class_entry *class_type TSRMLS_DC) {
+
+ zend_hash_copy(cluster->std.properties, &class_type->default_properties,
+ (copy_ctor_func_t)zval_add_ref, (void*)&tmp, sizeof(zval*));
++#else
++ object_properties_init(&cluster->std, class_type);
+ #endif
+
+ retval.handle = zend_objects_store_put(cluster,
diff --git a/php-pecl-redis.spec b/php-pecl-redis.spec
index 70fd763..fc906a2 100644
--- a/php-pecl-redis.spec
+++ b/php-pecl-redis.spec
@@ -33,12 +33,15 @@
Summary: Extension for communicating with the Redis key-value store
Name: %{?sub_prefix}php-pecl-redis
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/redis
+# Upstream
+Patch0: https://github.com/phpredis/phpredis/commit/9d15f07adb0de7ae02111f942bf7d0957bbc25d0.patch
+
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
%if %{with_igbin}
@@ -123,6 +126,7 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .upstream
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_REDIS_VERSION/{s/.* "//;s/".*$//;p}' php_redis.h)
@@ -306,6 +310,9 @@ fi
%changelog
+* Sun Nov 5 2017 Remi Collet <remi@remirepo.net> - 3.1.4-3
+- add upstream patch, fix segfault with PHP 5.x
+
* Tue Oct 17 2017 Remi Collet <remi@remirepo.net> - 3.1.4-2
- rebuild