commit 9de7c119e1758e613c820055497e586252886110 parent bb84abeea261ff5ee1941b7d3ae8c5a879ac28a8 Author: Ed van Bruggen <edvb@uw.edu> Date: Fri, 27 Mar 2020 02:36:12 -0700 Check correct integer bounds in hash Diffstat:
tisp.c | | | 3 | +-- |
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tisp.c b/tisp.c @@ -206,8 +206,7 @@ hash(char *key) { uint32_t h = 0; char c; - /* TODO ULONG_MAX is always bigger than uint32_t */ - while (h < ULONG_MAX && (c = *key++)) + while (h < UINT32_MAX && (c = *key++)) h = h * 33 + c; return h; }