diff options
Diffstat (limited to 'gcc/ada/s-fileio.adb')
-rw-r--r-- | gcc/ada/s-fileio.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb index 9028fd694ba..cf29b249533 100644 --- a/gcc/ada/s-fileio.adb +++ b/gcc/ada/s-fileio.adb @@ -34,6 +34,7 @@ with Ada.Finalization; use Ada.Finalization; with Ada.IO_Exceptions; use Ada.IO_Exceptions; with Interfaces.C_Streams; use Interfaces.C_Streams; +with System.CRTL; with System.Soft_Links; with Unchecked_Deallocation; @@ -43,6 +44,8 @@ package body System.File_IO is package SSL renames System.Soft_Links; + use type System.CRTL.size_t; + ---------------------- -- Global Variables -- ---------------------- @@ -812,6 +815,10 @@ package body System.File_IO is -- Normal case of non-null name given else + if Name'Length > Namelen then + raise Name_Error; + end if; + Namestr (1 .. Name'Length) := Name; Namestr (Name'Length + 1) := ASCII.NUL; end if; |