#28552 [Opn->Fbk]: openssl_pkcs7_encrypt segmentation fault
| From: | wez@php.net | Date: | Fri, 28 May 2004 11:18:12 +0000 |
| Subject: | #28552 [Opn->Fbk]: openssl_pkcs7_encrypt segmentation fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-60105@lists.php.net to get a copy of this message | ||
ID: 28552
Updated by: wez@php.net
Reported By: owen at name dot com
-Status: Open
+Status: Feedback
Bug Type: OpenSSL related
Operating System: RedHat/Linux version 2.4.20-8
PHP Version: 4.3.6
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Please build a debug build and submit a new backtrace.
Previous Comments:
------------------------------------------------------------------------
[2004-05-28 01:06:52] owen at name dot com
Description:
------------
When using openssl_pkcs7_encrypt, Apache seg faults. I can perform the
same smime related function with openssl alone but not in PHP.
I have tried different sized messages, different headers, different
certs, etc and it always seg faults.
Reproduce code:
---------------
$headers_array = explode("\r\n", $header);
$infilename = tempnam("/tmp/", "smime-in-");
$outfilename = tempnam("/tmp/", "smime-out-");
unlink($outfilename);
$fp2 = fopen($infilename, "w");
fwrite($fp2, $mimeData.substr($message, strpos($message,
"\r\n\r\n") + 2)."\r\n");
fclose($fp2);
$cert = $cert_array[0];
$encrypted = openssl_pkcs7_encrypt($infilename,
$outfilename, $cert, $headers_array, 0);
Expected result:
----------------
smime encrypted data to be written to $outfilename.
Actual result:
--------------
When ran in a browser the page stays the same and doesn't move on to
the page the code is being ran on and I get "child pid 5314 exit signal
Segmentation fault (11)" in the Apache error log. When ran from the
command line I get a sefmentation fault and a core dumped.
Here is the backtrace. Doesn't seem to be much there.
(gdb) bt
#0 0x08224f5d in PKCS7_dataInit ()
#1 0x08380160 in ?? ()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28552&edit=1