mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
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.
This commit is contained in:
parent
aaa33f144c
commit
2aea6ca326
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user