This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.

Tested on x86_64-pc-linux-gnu, committed on trunk

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]