* src/hash.c (jash_string): [SV 54980] Avoid ASAN error

This commit is contained in:
Paul Smith 2019-05-13 18:45:18 -04:00
parent b5de783f77
commit 9ce370249b
2 changed files with 32 additions and 27 deletions

View File

@ -446,6 +446,9 @@ unsigned jhash(unsigned const char *k, int length)
} while (0) } while (0)
#endif #endif
/* This function performs magic which is correct but causes ASAN heartburn
when we pass in a global constant string (at least). */
__attribute__((no_sanitize_address))
unsigned jhash_string(unsigned const char *k) unsigned jhash_string(unsigned const char *k)
{ {
unsigned int a, b, c; unsigned int a, b, c;

View File

@ -179,6 +179,8 @@ sub toplevel
foreach (# UNIX-specific things foreach (# UNIX-specific things
'TZ', 'TMPDIR', 'HOME', 'USER', 'LOGNAME', 'PATH', 'TZ', 'TMPDIR', 'HOME', 'USER', 'LOGNAME', 'PATH',
'LD_LIBRARY_PATH', 'LD_LIBRARY_PATH',
# SAN things
'ASAN_OPTIONS', 'UBSAN_OPTIONS',
# Purify things # Purify things
'PURIFYOPTIONS', 'PURIFYOPTIONS',
# Windows NT-specific stuff # Windows NT-specific stuff