diff --git a/NEWS b/NEWS index 50901b3926a9..3c68c6cd1390 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,10 @@ PHP NEWS . Fixed bug GH-9033 (Loading blacklist file can fail due to negative length). (cmb) +- OpenSSL: + . Fixed bug GH-9339 (OpenSSL oid_file path check warning contains + uninitialized path). (Jakub Zelenka) + - PDO_SQLite: . Fixed bug GH-9032 (SQLite3 authorizer crashes on NULL values). (cmb) diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index f791cfa85603..208776e33015 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -506,15 +506,15 @@ static bool php_openssl_check_path_ex( error_msg = "must not contain any null bytes"; error_type = E_ERROR; } else if (expand_filepath(fs_file_path, real_path) == NULL) { - error_msg = "The argument must be a valid file path"; + error_msg = "must be a valid file path"; } if (error_msg != NULL) { if (arg_num == 0) { const char *option_title = option_name ? option_name : "unknown"; const char *option_label = is_from_array ? "array item" : "option"; - php_error_docref(NULL, E_WARNING, "Path '%s' for %s %s %s", - real_path, option_title, option_label, error_msg); + php_error_docref(NULL, E_WARNING, "Path for %s %s %s", + option_title, option_label, error_msg); } else if (is_from_array && option_name != NULL) { php_openssl_check_path_error( arg_num, error_type, "option %s array item %s", option_name, error_msg); diff --git a/ext/openssl/tests/gh9339.phpt b/ext/openssl/tests/gh9339.phpt new file mode 100644 index 000000000000..9e4adbccce7f --- /dev/null +++ b/ext/openssl/tests/gh9339.phpt @@ -0,0 +1,25 @@ +--TEST-- +GH-9339: oid_file path check warning contains uninitialized path +--SKIPIF-- + +--FILE-- + $configFile ]); +?> +--CLEAN-- + +--EXPECTF-- + +Warning: openssl_pkey_new(): Path for oid_file option must be a valid file path in %s on line %d