[Ada] Fix IPv6 numeric address detection
authorDmitriy Anisimkov <anisimko@adacore.com>
Mon, 12 Aug 2019 09:01:58 +0000 (09:01 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 12 Aug 2019 09:01:58 +0000 (09:01 +0000)
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  <anisimko@adacore.com>

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
gcc/ada/libgnat/g-socket.adb

index 8b8a944..e603f04 100644 (file)
@@ -1,5 +1,10 @@
 2019-08-12  Dmitriy Anisimkov  <anisimko@adacore.com>
 
+       * libgnat/g-socket.adb (Is_IPv6_Address): Check that no less
+       then 2 colons in IPv6 numeric address.
+
+2019-08-12  Dmitriy Anisimkov  <anisimko@adacore.com>
+
        * libgnat/g-comlin.ads, libgnat/g-comlin.adb (Getopt): Add
        parameter Quiet. Need to do not output error messages to
        console. Invalid_Switch exception generation surrounded by an
index ceb2cb0..51817ea 100644 (file)
@@ -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;
 
    ---------------------