]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
sanitize util_hthash with a hack
authorWolfgang Bumiller <wry.git@bumiller.com>
Tue, 14 Feb 2017 18:23:02 +0000 (19:23 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Tue, 14 Feb 2017 18:26:05 +0000 (19:26 +0100)
To silence the address sanitizer.
Since this is gone in the master branch anyway this will
have to do.

stat.c

diff --git a/stat.c b/stat.c
index e7e5bb4143f110c03a02ca4215100346fa4c342a..c0d1022d7841c05c7a4467d1b93dfd604012fd9e 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -416,7 +416,9 @@ GMQCC_INLINE size_t util_hthash(hash_table_t *ht, const char *key) {
     uint32_t h = 0x1EF0 ^ len;
 
     for (i = -((int)block); i; i++) {
-        k  = blocks[i];
+        uint32_t hack;
+        memcpy(&hack, &blocks[i], sizeof(hack));
+        k  = hack;
         k *= mask1;
         k  = GMQCC_ROTL32(k, 15);
         k *= mask2;