From 38c043f50f80982b56e18e4422c6aa298202114d Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Sat, 24 Apr 2021 23:39:34 +0900 Subject: Check length of hostname with STR_SIZE_MAX --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 6f15e36..ced6f40 100644 --- a/main.c +++ b/main.c @@ -462,7 +462,7 @@ main(int argc, char **argv, char **envp) /* Don't use hostname if it is truncated. */ hostname[HOST_NAME_MAX + 1] = '\0'; hostname_len = strlen(hostname); - if (hostname_len <= HOST_NAME_MAX && hostname_len <= INT_MAX) + if (hostname_len <= HOST_NAME_MAX && hostname_len < STR_SIZE_MAX) HostName = allocStr(hostname, (int)hostname_len); } } -- cgit v1.2.3