php-src/ext/openssl/tests/bug38261.phpt

35 lines
705 B
Plaintext
Raw Normal View History

--TEST--
openssl key from zval leaks
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$cert = false;
class test {
function __toString() {
return "test object";
}
}
$t = new test;
2008-07-19 00:02:46 +00:00
var_dump(openssl_x509_parse(b"foo"));
var_dump(openssl_x509_parse($t));
var_dump(openssl_x509_parse(array()));
var_dump(openssl_x509_parse());
var_dump(openssl_x509_parse($cert));
var_dump(openssl_x509_parse(new stdClass));
?>
--EXPECTF--
bool(false)
bool(false)
bool(false)
2007-05-27 19:13:29 +00:00
Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)
Catchable fatal error: Object of class stdClass could not be converted to binary string in %s on line %d