aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-03-18 10:47:26 -0400
committerNick Mathewson <nickm@torproject.org>2014-03-18 10:47:26 -0400
commit2aea6ca3260cee82a60168c047f4d0cc71f7c652 (patch)
tree4f45d5ed11b0f964712121dcd341edb0240d932a /src
parentaaa33f144c4ad0db0c067df2f6703790be400acb (diff)
downloadtor-2aea6ca3260cee82a60168c047f4d0cc71f7c652.tar
tor-2aea6ca3260cee82a60168c047f4d0cc71f7c652.tar.gz
Fix a ubsan warning in our ctypes replacements
ubsan doesn't like 1<<31, since that's an undefined integer overflow. Instead, we should do 1u<<31.
Diffstat (limited to 'src')
-rw-r--r--src/common/compat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 32effa5c7..30a33031c 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -321,7 +321,7 @@ tor_memstr(const void *haystack, size_t hlen, const char *needle)
extern const uint32_t TOR_##name##_TABLE[]; \
static INLINE int TOR_##name(char c) { \
uint8_t u = c; \
- return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1 << (u & 31))); \
+ return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31))); \
}
DECLARE_CTYPE_FN(ISALPHA)
DECLARE_CTYPE_FN(ISALNUM)