-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Description
Description
Due to bug in the error message creation that is used in oid_file check, the uninitialized real_path
is printed. It doesn't really make much sense to print the path as the invalid one is either too long or contains \0
character
The following code:
<?php
$configFile = __DIR__ . '/custom.cnf';
file_put_contents($configFile, sprintf("oid_file = %s\n", __DIR__ . '/' . str_repeat('a', 9000)));
$pkey = openssl_pkey_new([ 'config' => $configFile ]);
Resulted in this output:
PHP Warning: openssl_pkey_new(): Path '�h,�' for oid_file option must be a valid file path in ...
But I expected this output instead:
PHP Warning: openssl_pkey_new(): Path for oid_file option must be a valid file path in ...
PHP Version
PHP 8.0
Operating System
Linux