com php-src: Store OpenSSL errors from CONF_get_string in SET_OPTIONAL_STRING_ARG: ext/openssl/openssl.c
| From: | Jakub Zelenka | Date: | Sun, 03 Apr 2016 18:51:22 +0000 |
| Subject: | com php-src: Store OpenSSL errors from CONF_get_string in SET_OPTIONAL_STRING_ARG: ext/openssl/openssl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92442@lists.php.net to get a copy of this message | ||
Commit: 79dd71b1517e97c1a7915a0eb150262248999f74
Author: Jakub Zelenka <bukka@php.net> Sun, 3 Apr 2016 19:51:22 +0100
Parents: 4ea2a0fd60cdf75d746909198ea69f1e3e4ba193
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=79dd71b1517e97c1a7915a0eb150262248999f74
Log:
Store OpenSSL errors from CONF_get_string in SET_OPTIONAL_STRING_ARG
Changed paths:
M ext/openssl/openssl.c
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 26eb120..60a3907 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -902,10 +902,16 @@ static int add_oid_section(struct php_x509_request * req) /* {{{ */
req->config_filename, req->var, req->req_config) == FAILURE) return FAILURE
#define SET_OPTIONAL_STRING_ARG(key, varname, defval) \
- if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key,
sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_STRING) \
- varname = Z_STRVAL_P(item); \
- else \
- varname = defval
+ do { \
+ if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key,
sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_STRING) { \
+ varname = Z_STRVAL_P(item); \
+ } else { \
+ varname = defval; \
+ if (varname == NULL) { \
+ php_openssl_store_errors(); \
+ } \
+ } \
+ } while(0)
#define SET_OPTIONAL_LONG_ARG(key, varname, defval) \
if (optional_args && (item = zend_hash_str_find(Z_ARRVAL_P(optional_args), key,
sizeof(key)-1)) != NULL && Z_TYPE_P(item) == IS_LONG) \