From 83ce1d58362836cfb803f90c31b7b5838430d022 Mon Sep 17 00:00:00 2001 From: Sunpoet Po-Chuan Hsieh Date: Wed, 7 Aug 2013 03:35:18 +0000 Subject: - Fix ossl_recv() to eliminate false positive OpenSSL errors - Bump PORTREVISION for package change Submitted by: Brett Gmoser , Sergey Lobanov Obtained from: https://github.com/bagder/curl/commit/8a7a277c086199b Reference: http://sourceforge.net/p/curl/bugs/1249/ --- ftp/curl/Makefile | 1 + ftp/curl/files/patch-lib-ssluse.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 ftp/curl/files/patch-lib-ssluse.c (limited to 'ftp') diff --git a/ftp/curl/Makefile b/ftp/curl/Makefile index f19fe7b8fb8e..ae265ae5e4ee 100644 --- a/ftp/curl/Makefile +++ b/ftp/curl/Makefile @@ -3,6 +3,7 @@ PORTNAME= curl PORTVERSION= 7.31.0 +PORTREVISION= 1 CATEGORIES= ftp ipv6 www MASTER_SITES= http://curl.haxx.se/download/ \ LOCAL/sunpoet diff --git a/ftp/curl/files/patch-lib-ssluse.c b/ftp/curl/files/patch-lib-ssluse.c new file mode 100644 index 000000000000..7b6d65772865 --- /dev/null +++ b/ftp/curl/files/patch-lib-ssluse.c @@ -0,0 +1,28 @@ +--- lib/ssluse.c.orig ++++ lib/ssluse.c +@@ -2608,13 +2608,19 @@ static ssize_t ossl_recv(struct connectdata *conn, /* connection data */ + *curlcode = CURLE_AGAIN; + return -1; + default: +- /* openssl/ssl.h says "look at error stack/return value/errno" */ ++ /* openssl/ssl.h for SSL_ERROR_SYSCALL says "look at error stack/return ++ value/errno" */ ++ /* http://www.openssl.org/docs/crypto/ERR_get_error.html */ + sslerror = ERR_get_error(); +- failf(conn->data, "SSL read: %s, errno %d", +- ERR_error_string(sslerror, error_buffer), +- SOCKERRNO); +- *curlcode = CURLE_RECV_ERROR; +- return -1; ++ if((nread < 0) || sslerror) { ++ /* If the return code was negative or there actually is an error in the ++ queue */ ++ failf(conn->data, "SSL read: %s, errno %d", ++ ERR_error_string(sslerror, error_buffer), ++ SOCKERRNO); ++ *curlcode = CURLE_RECV_ERROR; ++ return -1; ++ } + } + } + return nread; -- cgit v1.2.3