summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--memcached-build.patch41
-rw-r--r--php-pecl-memcached.spec14
2 files changed, 51 insertions, 4 deletions
diff --git a/memcached-build.patch b/memcached-build.patch
new file mode 100644
index 0000000..2ce2cba
--- /dev/null
+++ b/memcached-build.patch
@@ -0,0 +1,41 @@
+Adapted for 3.7.0 from:
+
+From d226ee7d45538a853160d6e2264a56c121700775 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 30 Jan 2024 09:44:48 +0100
+Subject: [PATCH] Fix incompatible pointer types
+
+---
+ php_memcached.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/php_memcached.c b/php_memcached.c
+index 00d5e3d4..c3ef16e8 100644
+--- a/php_memcached.c
++++ b/php_memcached.c
+@@ -899,10 +899,11 @@ zend_bool s_compress_value (php_memc_com
+
+ case COMPRESSION_TYPE_ZLIB:
+ {
+- compressed_size = buffer_size;
+- int status = compress((Bytef *) buffer, &compressed_size, (Bytef *) ZSTR_VAL(payload), ZSTR_LEN(payload));
++ unsigned long cs = compressed_size = buffer_size;
++ int status = compress((Bytef *) buffer, &cs, (Bytef *) ZSTR_VAL(payload), ZSTR_LEN(payload));
+
+ if (status == Z_OK) {
++ compressed_size = cs;
+ compress_status = 1;
+ compression_type_flag = MEMC_VAL_COMPRESSION_ZLIB;
+ }
+@@ -3633,7 +3634,10 @@ zend_string *s_decompress_value (const c
+ decompress_status = ((length = fastlz_decompress(payload, payload_len, &buffer->val, buffer->len)) > 0);
+ }
+ else if (is_zlib) {
+- decompress_status = (uncompress((Bytef *) buffer->val, &buffer->len, (Bytef *)payload, payload_len) == Z_OK);
++ unsigned long ds = buffer->len;
++
++ decompress_status = (uncompress((Bytef *) buffer->val, &ds, (Bytef *)payload, payload_len) == Z_OK);
++ buffer->len = ds;
+ }
+
+ ZSTR_VAL(buffer)[stored_length] = '\0';
diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec
index 55f8d2e..6d01272 100644
--- a/php-pecl-memcached.spec
+++ b/php-pecl-memcached.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-memcached
#
-# Copyright (c) 2009-2023 Remi Collet
+# Copyright (c) 2009-2024 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -39,14 +39,15 @@
Summary: Extension to work with the Memcached caching daemon
Name: %{?scl_prefix}php-pecl-memcached
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
-Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
# upstream patch for PHP 8.2
Patch0: %{pecl_name}-upstream.patch
+Patch1: %{pecl_name}-build.patch
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -153,7 +154,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd %{sources}
-%patch -P0 -p1
+%patch -P0 -p1 -b .up
+%patch -P1 -p1 -b .pr555
%if %{with fastlz}
rm -r fastlz
@@ -360,6 +362,10 @@ exit $ret
%changelog
+* Tue Jan 30 2024 Remi Collet <remi@remirepo.net> - 3.2.0-9
+- fix incompatible pointer types using patch from
+ https://github.com/php-memcached-dev/php-memcached/pull/555
+
* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 3.2.0-7
- rebuild for PHP 8.3.0RC1