From: Marc Dionne Date: Thu, 11 Oct 2007 18:48:35 +0000 (+0000) Subject: STABLE14-gcc42-integer-overflow-fix-20071007 X-Git-Tag: openafs-stable-1_4_5-pre1 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b14fed71a526d126f37f2bd2a7b78cff043df754;p=packages%2Fo%2Fopenafs.git STABLE14-gcc42-integer-overflow-fix-20071007 fix issue where gcc 4.2 compiled kernel modules were breaking on linux ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== with fix from Hans-Werner Pulsen ==================== with fix from Hans-Werner Pulsen (cherry picked from commit 7832148ae0e8c9f17a2ac2eb879c7b2fdf69403e) --- diff --git a/src/dir/dir.c b/src/dir/dir.c index b7f40a337..cfbf2d3da 100644 --- a/src/dir/dir.c +++ b/src/dir/dir.c @@ -478,7 +478,7 @@ DirHash(register char *string) { /* Hash a string to a number between 0 and NHASHENT. */ register unsigned char tc; - register int hval; + unsigned int hval; register int tval; hval = 0; while ((tc = (*string++))) { @@ -488,7 +488,7 @@ DirHash(register char *string) tval = hval & (NHASHENT - 1); if (tval == 0) return tval; - else if (hval < 0) + else if (hval >= 1<<31) tval = NHASHENT - tval; return tval; }