summaryrefslogtreecommitdiffstats
path: root/redis-pr1057.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-12-16 16:27:39 +0100
committerRemi Collet <fedora@famillecollet.com>2016-12-16 16:27:39 +0100
commit47a21c187b97f357da6e647850d76e647baa6b81 (patch)
treec19d7bc128094dce45996dfb5c8f2a953020ca33 /redis-pr1057.patch
parent296875f47068c45e3b5baa6a9a5d958b577672b8 (diff)
php-pecl-redis: test build for upcoming 3.1.1 (the patches)
Diffstat (limited to 'redis-pr1057.patch')
-rw-r--r--redis-pr1057.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/redis-pr1057.patch b/redis-pr1057.patch
new file mode 100644
index 0000000..361cd9d
--- /dev/null
+++ b/redis-pr1057.patch
@@ -0,0 +1,61 @@
+From 61c02e2985494b3de6ebbbd25f622085ca4b1103 Mon Sep 17 00:00:00 2001
+From: Pavlo Yatsukhnenko <yatsukhnenko@gmail.com>
+Date: Thu, 15 Dec 2016 15:08:17 +0200
+Subject: [PATCH] Fix segfault in testSerializerIGBinary
+
+---
+ library.c | 14 ++++++++------
+ redis.c | 6 +++---
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/library.c b/library.c
+index a48fc41..4182d24 100644
+--- a/library.c
++++ b/library.c
+@@ -2087,14 +2087,16 @@ redis_unserialize(RedisSock* redis_sock, const char *val, int val_len,
+ {
+ /* This is most definitely not an igbinary string, so do
+ not try to unserialize this as one. */
+- return 0;
++ break;
+ }
+
+- if(igbinary_unserialize((const uint8_t *)val, (size_t)val_len,
+- z_ret TSRMLS_CC) == 0
+- ) {
+- ret = 1;
+- }
++#if (PHP_MAJOR_VERSION < 7)
++ INIT_PZVAL(z_ret);
++ ret = !igbinary_unserialize((const uint8_t *)val, (size_t)val_len, &z_ret TSRMLS_CC);
++#else
++ ret = !igbinary_unserialize((const uint8_t *)val, (size_t)val_len, z_ret TSRMLS_CC);
++#endif
++
+ #endif
+ break;
+ }
+diff --git a/redis.c b/redis.c
+index 2b27b5f..25297d6 100644
+--- a/redis.c
++++ b/redis.c
+@@ -527,6 +527,9 @@ static void add_class_constants(zend_class_entry *ce, int is_cluster TSRMLS_DC)
+ /* serializer */
+ zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_NONE"), REDIS_SERIALIZER_NONE TSRMLS_CC);
+ zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_PHP"), REDIS_SERIALIZER_PHP TSRMLS_CC);
++#ifdef HAVE_REDIS_IGBINARY
++ zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_IGBINARY"), REDIS_SERIALIZER_IGBINARY TSRMLS_CC);
++#endif
+
+ /* scan options*/
+ zend_declare_class_constant_long(ce, ZEND_STRL("OPT_SCAN"), REDIS_OPT_SCAN TSRMLS_CC);
+@@ -541,9 +544,6 @@ static void add_class_constants(zend_class_entry *ce, int is_cluster TSRMLS_DC)
+ zend_declare_class_constant_long(ce, ZEND_STRL("FAILOVER_DISTRIBUTE"), REDIS_FAILOVER_DISTRIBUTE TSRMLS_CC);
+ zend_declare_class_constant_long(ce, ZEND_STRL("FAILOVER_DISTRIBUTE_SLAVES"), REDIS_FAILOVER_DISTRIBUTE_SLAVES TSRMLS_CC);
+ }
+-#ifdef HAVE_REDIS_IGBINARY
+- zend_declare_class_constant_long(ce, ZEND_STRL("SERIALIZER_IGBINARY"), REDIS_SERIALIZER_IGBINARY TSRMLS_CC);
+-#endif
+
+ zend_declare_class_constant_stringl(ce, "AFTER", 5, "after", 5 TSRMLS_CC);
+ zend_declare_class_constant_stringl(ce, "BEFORE", 6, "before", 6 TSRMLS_CC);