From 1af016e96e133718546b55c8b7fafd3345aaeeb8 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Sun, 11 Feb 2018 16:39:23 +0100 Subject: Do not consider IP strings valid DNS names. Fixes #25055 --- src/test/test_util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test') diff --git a/src/test/test_util.c b/src/test/test_util.c index b67fad58e3..2fa03e5bc7 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -5584,6 +5584,11 @@ test_util_hostname_validation(void *arg) tt_assert(!string_is_valid_hostname(".")); tt_assert(!string_is_valid_hostname("..")); + // IP address strings are not hostnames. + tt_assert(!string_is_valid_hostname("8.8.8.8")); + tt_assert(!string_is_valid_hostname("[2a00:1450:401b:800::200e]")); + tt_assert(!string_is_valid_hostname("2a00:1450:401b:800::200e")); + done: return; } -- cgit v1.2.3-54-g00ecf