From 06fb02549646d26eea438361ebc0b4f0893cf01f Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Thu, 25 Feb 2021 22:36:06 -0500 Subject: Error if hash bound is less than 2 Bad things happen otherwise. --- chat.c | 1 + 1 file changed, 1 insertion(+) (limited to 'chat.c') diff --git a/chat.c b/chat.c index 7335520..60ec7d2 100644 --- a/chat.c +++ b/chat.c @@ -123,6 +123,7 @@ uint32_t hashBound = 75; static void parseHash(char *str) { hashInit = strtoul(str, &str, 0); if (*str) hashBound = strtoul(&str[1], NULL, 0); + if (hashBound < 2) errx(EX_USAGE, "hash bound must be >= 2"); } #ifdef __OpenBSD__ -- cgit 1.4.1-2-gfad0