diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-10-17 10:03:38 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-10-17 10:03:38 +0200 |
commit | 5b64eca514d9a8d7ed305e9bfdb9ab0d65185772 (patch) | |
tree | 3bda0f42d37bf79b71112fc1d4da7797f7a56a0e | |
parent | f812b41f5c17a1476bdc436e2a6031c13328cff9 (diff) |
php-pecl-yaml: add upstream patch, fix segfault
-rw-r--r-- | php-pecl-yaml-dev.spec | 14 | ||||
-rw-r--r-- | yaml-upstream.patch | 56 |
2 files changed, 67 insertions, 3 deletions
diff --git a/php-pecl-yaml-dev.spec b/php-pecl-yaml-dev.spec index 0962acb..89901f2 100644 --- a/php-pecl-yaml-dev.spec +++ b/php-pecl-yaml-dev.spec @@ -34,13 +34,16 @@ Summary: PHP Bindings for yaml Name: %{?sub_prefix}php-pecl-yaml Version: 2.0.0 -Release: 0.1.%{prever}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 0.2.%{prever}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT Group: Development/Languages URL: http://pecl.php.net/package/yaml Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +# Upstream patch +Patch0: %{pecl_name}-upstream.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear @@ -99,6 +102,8 @@ mv %{pecl_name}-%{version}%{?prever} NTS sed -e '/role="test"/d' -i package.xml cd NTS +%patch0 -p1 -b .upstream + # Check upstream version (often broken) extver=$(sed -n '/#define PHP_YAML_VERSION/{s/.* "//;s/".*$//;p}' php_yaml.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -188,7 +193,7 @@ cd NTS TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ -REPORT_EXIT_STATUS=0 \ +REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php --show-diff %if %{with_zts} @@ -202,7 +207,7 @@ cd ../ZTS TEST_PHP_EXECUTABLE=%{__ztsphp} \ TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ -REPORT_EXIT_STATUS=0 \ +REPORT_EXIT_STATUS=1 \ %{__ztsphp} -n run-tests.php --show-diff %endif @@ -246,6 +251,9 @@ fi %changelog +* Sat Oct 17 2015 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.2.RC2 +- add uptream patches, fix segfault and test suite + * Sat Oct 17 2015 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.1.RC2 - update to 2.0.0RC2 for PHP 7 - 2 failed tests, so ignore test suite results for now diff --git a/yaml-upstream.patch b/yaml-upstream.patch new file mode 100644 index 0000000..c2bf423 --- /dev/null +++ b/yaml-upstream.patch @@ -0,0 +1,56 @@ +From b015af52451b90bc38463ea4915c150de4a1b9d9 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@php.net> +Date: Sat, 17 Oct 2015 09:42:29 +0200 +Subject: [PATCH] free later, fix tests/yaml_emit_005.phpt failure + +--- + emit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/emit.c b/emit.c +index faa4d07..d210acc 100644 +--- a/emit.c ++++ b/emit.c +@@ -668,13 +668,13 @@ static int y_write_object( + NULL, (yaml_char_t *) YAML_PHP_TAG, (yaml_char_t *) buf.s->val, buf.s->len, + 0, 0, YAML_DOUBLE_QUOTED_SCALAR_STYLE); + +- smart_string_free(&buf); + if (!status) { + y_event_init_failed(&event); + status = FAILURE; + } else { + status = y_event_emit(state, &event TSRMLS_CC); + } ++ smart_string_free(&buf); + } + + return status; +-- +2.1.4 + +From 2538b42347d1fc390ebd88ef1c1ca4164c2faecf Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@php.net> +Date: Sat, 17 Oct 2015 09:46:19 +0200 +Subject: [PATCH] missing init value, fix segfault in tests/bug_64694.phpt + +--- + parse.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parse.c b/parse.c +index d52753a..dbd8cd5 100644 +--- a/parse.c ++++ b/parse.c +@@ -880,7 +880,7 @@ static char *convert_to_char(zval *zv TSRMLS_DC) + default: + { + php_serialize_data_t var_hash; +- smart_str buf; ++ smart_str buf = {0}; + + PHP_VAR_SERIALIZE_INIT(var_hash); + php_var_serialize(&buf, zv, &var_hash TSRMLS_CC); +-- +2.1.4 + |