s3:modules: Avoid setting the sign bit to 1.
authorAndreas Schneider <asn@samba.org>
Fri, 25 Aug 2017 12:11:02 +0000 (14:11 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 25 Aug 2017 14:15:08 +0000 (16:15 +0200)
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fileid.c

index f751486535a141a80c549e1b1b3c7824ae93bb71..bb0a79c0d655ed6e2f119b193dcd8ae52c16c237 100644 (file)
@@ -129,7 +129,7 @@ static uint64_t fileid_uint64_hash(const uint8_t *s, size_t len)
 
        /* Set the initial value from the key size. */
        for (value = 0x238F13AFLL * len, i=0; i < len; i++)
-               value = (value + (s[i] << (i*5 % 24)));
+               value = (value + (((uint64_t)s[i]) << (i*5 % 24)));
 
        return (1103515243LL * value + 12345LL);
 }