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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
21 + 46 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Apr 23 15:01:32 2024 UTC