[quake3] md5.c is not 64 bit-safe.

Erik Auerswald auerswal at unix-ag.uni-kl.de
Wed Apr 26 11:35:52 EDT 2006


On Wed, Apr 26, 2006 at 10:11:40AM -0500, Tony J. White wrote:
> On Wed, Apr 26, 2006 at 03:45:16PM +0200, Thilo Schulz wrote:
> > In GCC sizeof(long int) is 8 bytes on 64 bit platforms but only 4 bytes
> > on 32 bit platforms.
> Sorry.
> Could someone with a 64-bit platform please test the attached patch for md5.c?
> I used the same uint32 defines from md4.c so I assume it works for determining
> that type on all build targets.

In the file server/sv_rankings.c uint32_t is used, so maybe this could
be used instead since an int might be larger than 4 bytes (which is
checked in qcommon/md4.c).

Replacing every "unsigned long int" by "uint32_t" in qcommon/md5.c
compiles on linux/x86 (32bit), I can't check any other platform. I did
_not_ check every integer type in that file for size assumptions, so a
simple search and replace might not be enough.


More information about the quake3 mailing list