summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-10-04 09:40:56 +0200
committerRemi Collet <fedora@famillecollet.com>2014-10-04 09:40:56 +0200
commitc0e9660da5644ab6503a9ec91c10c429359452e4 (patch)
tree978fb5f3fa158d70d744bb7c8b6799fed9ddd051
parentba3bbf686aabe4355459af25e01684cd0579526b (diff)
php-pecl-redis: test build
-rw-r--r--php-pecl-redis.spec9
-rw-r--r--redis-igbinary.patch27
2 files changed, 35 insertions, 1 deletions
diff --git a/php-pecl-redis.spec b/php-pecl-redis.spec
index 58d3ffc..974a673 100644
--- a/php-pecl-redis.spec
+++ b/php-pecl-redis.spec
@@ -25,7 +25,7 @@
Summary: Extension for communicating with the Redis key-value store
Name: %{?scl_prefix}php-pecl-redis
Version: 2.2.5
-Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/redis
@@ -35,6 +35,8 @@ Source1: https://github.com/nicolasff/phpredis/archive/%{version}.tar.gz
# https://github.com/nicolasff/phpredis/pull/447
Patch0: %{pecl_name}-php56.patch
+# https://github.com/nicolasff/phpredis/pull/517
+Patch1: %{pecl_name}-igbinary.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: %{?scl_prefix}php-devel
@@ -96,6 +98,7 @@ mv phpredis-%{version}/tests nts/tests
cd nts
%patch0 -p1 -b .php56
+%patch1 -p1 -b .igbinary
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_REDIS_VERSION/{s/.* "//;s/".*$//;p}' php_redis.h)
@@ -263,6 +266,10 @@ rm -rf %{buildroot}
%changelog
+* Fri Oct 3 2014 Remi Collet <rcollet@redhat.com> - 2.2.5-4.1
+- test build for segfault with igbinary
+ https://github.com/nicolasff/phpredis/issues/341
+
* Mon Aug 25 2014 Remi Collet <rcollet@redhat.com> - 2.2.5-4
- improve SCL build
diff --git a/redis-igbinary.patch b/redis-igbinary.patch
new file mode 100644
index 0000000..6af7538
--- /dev/null
+++ b/redis-igbinary.patch
@@ -0,0 +1,27 @@
+From aecfbfd650d6b504193d48f82a4a170ce3ce4cd6 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Fri, 3 Oct 2014 19:19:33 +0200
+Subject: [PATCH] Fix segfault with igbinary, fix #341
+
+---
+ library.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/library.c b/library.c
+index 40d43fa..3e91e93 100644
+--- a/library.c
++++ b/library.c
+@@ -1646,11 +1646,12 @@ redis_unserialize(RedisSock *redis_sock, const char *val, int val_len, zval **re
+ #ifdef HAVE_REDIS_IGBINARY
+ if(!*return_value) {
+ MAKE_STD_ZVAL(*return_value);
++ rv_free = 1;
+ }
+ if(igbinary_unserialize((const uint8_t *)val, (size_t)val_len, return_value TSRMLS_CC) == 0) {
+ return 1;
+ }
+- efree(*return_value);
++ if(rv_free==1) efree(*return_value);
+ #endif
+ return 0;
+ break;