From 8467866f26927d46be47240308278a867e3fb2b0 Mon Sep 17 00:00:00 2001 From: Dmitriy Anisimkov Date: Mon, 12 Aug 2019 09:01:58 +0000 Subject: [PATCH] [Ada] Fix IPv6 numeric address detection IPv6 numeric address can't have less than 2 colons. It fixes the error when Get_Host_By_Name called with hostname composed by only hexadecimal symbols. 2019-08-12 Dmitriy Anisimkov gcc/ada/ * libgnat/g-socket.adb (Is_IPv6_Address): Check that no less then 2 colons in IPv6 numeric address. From-SVN: r274308 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/libgnat/g-socket.adb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8b8a944ef65d..e603f04da002 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-08-12 Dmitriy Anisimkov + + * libgnat/g-socket.adb (Is_IPv6_Address): Check that no less + then 2 colons in IPv6 numeric address. + 2019-08-12 Dmitriy Anisimkov * libgnat/g-comlin.ads, libgnat/g-comlin.adb (Getopt): Add diff --git a/gcc/ada/libgnat/g-socket.adb b/gcc/ada/libgnat/g-socket.adb index ceb2cb03c6a7..51817ea94d55 100644 --- a/gcc/ada/libgnat/g-socket.adb +++ b/gcc/ada/libgnat/g-socket.adb @@ -1797,7 +1797,7 @@ package body GNAT.Sockets is end if; end loop; - return Colons <= 8; + return Colons in 2 .. 8; end Is_IPv6_Address; --------------------- -- 2.43.5