Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community/php7: add patch for curl #6674

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions community/php7/5025eb05bde83a0a51eb0668c45c240b366545bf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 5025eb05bde83a0a51eb0668c45c240b366545bf Mon Sep 17 00:00:00 2001
From: Jay Satiro <raysatiro@yahoo.com>
Date: Fri, 1 Mar 2019 01:37:00 -0500
Subject: [PATCH] curl_error: return an empty string if no error occurred

CURLOPT_ERRORBUFFER doc says "Do not rely on the contents of the
buffer unless an error code was returned." [1]

Prior to this change the error buffer was returned even if no error had
occurred, and that buffer may contain incorrect information in such a
case. [2]

[1]: https://curl.haxx.se/libcurl/c/CURLOPT_ERRORBUFFER.html
[2]: https://github.com/curl/curl/issues/3629
---
ext/curl/interface.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 3af7ec12e23c..a252bb3a219d 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -3310,8 +3310,12 @@ PHP_FUNCTION(curl_error)
RETURN_FALSE;
}

- ch->err.str[CURL_ERROR_SIZE] = 0;
- RETURN_STRING(ch->err.str);
+ if (ch->err.no) {
+ ch->err.str[CURL_ERROR_SIZE] = 0;
+ RETURN_STRING(ch->err.str);
+ } else {
+ RETURN_EMPTY_STRING();
+ }
}
/* }}} */

6 changes: 4 additions & 2 deletions community/php7/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
pkgname=php7
_pkgreal=php
pkgver=7.2.16
pkgrel=0
pkgrel=1
_apiver=20170718
_suffix=${pkgname#php}
# Is this package the default (latest) PHP version?
Expand Down Expand Up @@ -100,6 +100,7 @@ source="https://php.net/distributions/$_pkgreal-$pkgver.tar.bz2
php7-fpm-version-suffix.patch
allow-build-recode-and-imap-together.patch
fix-tests-devserver.patch
5025eb05bde83a0a51eb0668c45c240b366545bf.patch
"
builddir="$srcdir/$_pkgreal-$pkgver"

Expand Down Expand Up @@ -656,4 +657,5 @@ f1177cbf6b1f44402f421c3d317aab1a2a40d0b1209c11519c1158df337c8945f3a313d689c93976
db4c47cb254d208e4055db9287f4f4bacc0339f1f5912d2bf9c66e8a0fd0db9d53fb02aaa6d30a823a4b8504a04a9ce906706f3792684654131bb5b26aeb77b2 sharedir.patch
6d4aa75b94ce7c88f97574a06964fafd7cb6657c1cb19c0b93776dedef05857331cce9c40f69a442ef84c66aa9137ad9f6197cc25f2384a27b8fd7350838292e php7-fpm-version-suffix.patch
f8ecae241a90cbc3e98aa4deb3d5d35ef555f51380e29f4e182a8060dffeb84be74f030a14c6b452668471030d78964f52795ca74275db05543ccad20ef1f2cc allow-build-recode-and-imap-together.patch
5bb1f90de8c543d4efffa8bc604fb3239e478d9d9625d30cd03449643906a0fe5407123403206ec57f4bf9f18893a7ff4524ccf417b2bd8bce4ee7d18815b576 fix-tests-devserver.patch"
5bb1f90de8c543d4efffa8bc604fb3239e478d9d9625d30cd03449643906a0fe5407123403206ec57f4bf9f18893a7ff4524ccf417b2bd8bce4ee7d18815b576 fix-tests-devserver.patch
36fa7471d847d7044202fb2b8dfd137769eb3a69562cb021e22f42923fde830518468ee68dc64593278794732295f0ac58f2b0c66a5f64dcfbeded5bf5cbd635 5025eb05bde83a0a51eb0668c45c240b366545bf.patch"