php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47969 ezmlm_hash() returns different values depend on OS
Submitted: 2009-04-14 17:53 UTC Modified: 2009-04-15 14:25 UTC
From: lochoda at endai dot com Assigned:
Status: Closed Package: Mail related
PHP Version: 5.2.9 OS: freebsd 64bit, linux 64bit
Private report: No CVE-ID: None
 [2009-04-14 17:53 UTC] lochoda at endai dot com
Description:
------------
ezmlm_hash() returns different values depend on OS (32bit vs. 64bit)

The problem is with types used in the algorithm. 
Easy fix that works for unix and linux is to change 
unsigned long h = 5381L;
to
unsigned int h = 5381;

because int is always 4byte type on linux and unix.






Reproduce code:
---------------
run ezmlm_hash() on linux 32bit and 64bit and compare results

Expected result:
----------------
the same results

Actual result:
--------------
different results

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-15 14:25 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC