From:             wdierkes at 5dollarwhitebox dot org
Operating system: Redhat Enterprise Linux ES 3
PHP version:      5.2.2
PHP Bug Type:     Reproducible crash
Bug description:  Mhash extension SegFaults on MD5 algorithm

Description:
------------
The Mhash extension SegFaults on Redhat Enterprise Linux ES 3 when using
the MD5 algorithm.  All other algorithms seem to work except MD5.

NOTE: This appears to possibly be related to bug #30983 which is closed
(and I could not touch it).  In that bug, it was claimed to 'not imply a
bug in PHP itself'.  This may be true, however similar tests against the
Mhash library itself using C code function as expected.


I ran the same test against the Mhash library using the following C code
located here:

http://www.5dollarwhitebox.org/tmp/mhash_test.c


You must install the Mhash library obviously, then compile and run the
test file:

[EMAIL PROTECTED] ~]$ gcc -lmhash -o mhash_test mhash_test.c
[EMAIL PROTECTED] ~]$ ./mhash_test



The issue exists on Rhel3 i386/x86_64, but does *not* exist on Rhel4.. 
and I am using Mhash-0.9.9

Reproduce code:
---------------
PHP Code:

<?php
    $input = "PassW0rd";
    print "clear text input: " . $input . "\n";
    $tmp_hash_name = mhash_get_hash_name(MHASH_MD5);
    print "hash name: " . $tmp_hash_name . "\n";
    print "hash follows: "; 
    print bin2hex(mhash(MHASH_MD5, $input)) . "\n";
?>

Expected result:
----------------
Expected PHP Output:

[EMAIL PROTECTED] ~]$ php mhash_test.php 
clear text input: PassW0rd
hash name: MD5
hash follows: 298cde70c32a57b84d0a546fedbb2596


Actual result:
--------------
Actual PHP Output:

[EMAIL PROTECTED] ~/]$ php mhash_test.php 
clear text input: PassW0rd
hash name: MD5
hash follows: Segmentation fault

-- 
Edit bug report at http://bugs.php.net/?id=41545&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41545&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41545&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41545&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41545&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41545&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41545&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41545&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41545&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41545&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41545&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41545&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41545&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41545&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41545&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41545&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41545&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41545&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41545&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41545&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41545&r=mysqlcfg

Reply via email to