Skip to content

Commit 756667e

Browse files
fix: use portable IP string length limit
Signed-off-by: simpliq-marvin <[email protected]>
1 parent 6f5ddb7 commit 756667e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/config/validator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ bool validate_ip_array(union conf_value *val, const char *key, char err[VALIDATO
239239
return false;
240240
}
241241

242-
if(len > ADDRSTRLEN)
242+
if(len > INET6_ADDRSTRLEN)
243243
{
244244
snprintf(err, VALIDATOR_ERRBUF_LEN, "%s[%d]: address too long (\"%s\")", key, i, item->valuestring);
245245
return false;
246246
}
247247

248-
char ip[ADDRSTRLEN + 1] = { 0 };
248+
char ip[INET6_ADDRSTRLEN + 1] = { 0 };
249249
memcpy(ip, raw, len);
250250

251251
struct in_addr addr4;

0 commit comments

Comments
 (0)