summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/bug38261.phpt
blob: 66919473203a74cea344b3f1fffb276c4e6f450a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--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;

var_dump(openssl_x509_parse("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)

Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %sbug38261.php on line %d
NULL
bool(false)

Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug38261.php on line %d