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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lochoda at endai dot com
New email:
PHP Version: OS:

 

 [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: Thu May 09 04:01:31 2024 UTC