|  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
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;
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-15 14:25 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 11:01:25 2019 UTC