[PATCH] one more possible seg fault in openssl
| From: | Kamesh Jayachandran | Date: | Wed, 27 Oct 2004 10:36:17 +0000 |
| Subject: | [PATCH] one more possible seg fault in openssl | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-13559@lists.php.net to get a copy of this message | ||
Hi Wez,
<?php
$dn = array(
"countryName" => "UK",
"stateOrProvinceName" => "Somerset",
"localityName" => "Glastonbury",
"organizationName" => "The Brain Room Limited",
"organizationalUnitName" => "PHP Documentation Team",
"commonName" => "Wez Furlong",
"emailAddress" => "wez@example.com"
);
// Non-existent or null private key
$csr = openssl_csr_new($dn, $privkey1);
?>
will also cause the double free of privkey and hence potential seg
fault.
openssl_csr_new tries to create a fresh private key and adds to the
resource list and fails to req.priv_key to null so the dispose function
frees the private key generated. Later when the php_request_shutdown is
called it agains frees the EG(regular_list) this causes the seg fault.
Patch is available at,
http://puggy.symonds.net/~kameshj/openssl.c.patch
With regards
Kamesh Jayachandran