From 566104f0a3bf34c619c3d0bc77e5a1783fd3ee01 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 28 Jan 2020 12:58:05 +0100 Subject: add upstream patch to fix segfault in timeout --- c88f94839aab4cfe4507588fcd658184bcbce284.patch | 35 ++++++++++++++++++++++++++ php-pecl-couchbase2.spec | 9 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 c88f94839aab4cfe4507588fcd658184bcbce284.patch diff --git a/c88f94839aab4cfe4507588fcd658184bcbce284.patch b/c88f94839aab4cfe4507588fcd658184bcbce284.patch new file mode 100644 index 0000000..b1694b7 --- /dev/null +++ b/c88f94839aab4cfe4507588fcd658184bcbce284.patch @@ -0,0 +1,35 @@ +From c88f94839aab4cfe4507588fcd658184bcbce284 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 20 Jan 2020 15:04:56 +0100 +Subject: [PATCH] fix possible segfault if htresp is null + +close #23 + +Change-Id: Ia4dea8793a86a4ded07ccecc52e625842c098811 +Reviewed-on: http://review.couchbase.org/121246 +Tested-by: Build Bot +Reviewed-by: Sergey Avseyev +--- + src/couchbase/bucket/n1ql.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/couchbase/bucket/n1ql.c b/src/couchbase/bucket/n1ql.c +index 7d60b6b..8d8da13 100644 +--- a/src/couchbase/bucket/n1ql.c ++++ b/src/couchbase/bucket/n1ql.c +@@ -81,8 +81,13 @@ static void n1qlrow_callback(lcb_t instance, int ignoreme, const lcb_RESPN1QL *r + } + } + if (!reported) { +- pcbc_log(LOGARGS(instance, ERROR), "Failed to perform N1QL query. %d: %.*s", (int)resp->htresp->htstatus, +- (int)resp->nrow, (char *)resp->row); ++ if (resp->htresp) { ++ pcbc_log(LOGARGS(instance, ERROR), "Failed to perform N1QL query. %d: %.*s", (int)resp->htresp->htstatus, ++ (int)resp->nrow, (char *)resp->row); ++ } else { ++ pcbc_log(LOGARGS(instance, ERROR), "Failed to perform N1QL query. %.*s", ++ (int)resp->nrow, (char *)resp->row); ++ } + } + } + diff --git a/php-pecl-couchbase2.spec b/php-pecl-couchbase2.spec index 1aa96e1..d68aebc 100644 --- a/php-pecl-couchbase2.spec +++ b/php-pecl-couchbase2.spec @@ -26,11 +26,13 @@ Summary: Couchbase Server PHP extension Name: %{?sub_prefix}php-pecl-couchbase2 Version: 2.6.1 -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: https://pecl.php.net/package/couchbase Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Patch0: https://github.com/couchbase/php-couchbase/commit/c88f94839aab4cfe4507588fcd658184bcbce284.patch + BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 5.6 BuildRequires: %{?scl_prefix}php-pear @@ -106,6 +108,8 @@ mv %{pecl_name}-%{version}%{?prever} NTS %{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} cd NTS +%patch0 -p1 -b .up + # Drop bundled library sed -e '/fastlz/d' -i ../package.xml rm -r fastlz @@ -240,6 +244,9 @@ fi %changelog +* Tue Jan 28 2020 Remi Collet - 2.6.1-4 +- add upstream patch to fix segfault in timeout + * Fri Jan 17 2020 Remi Collet - 2.6.1-3 - rebuild against libcouchase 2.10.5 for https://github.com/remicollet/remirepo/issues/136 -- cgit