summaryrefslogtreecommitdiff
path: root/gcc/ada/adaint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/adaint.c')
-rw-r--r--gcc/ada/adaint.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index 674df74dad4..52e00960b0e 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -1339,7 +1339,10 @@ __gnat_stat (char *name, struct stat *statbuf)
terminated by a directory separator except if just after a drive name. */
int name_len = strlen (name);
char last_char = name[name_len - 1];
- char win32_name[4096];
+ char win32_name[GNAT_MAX_PATH_LEN + 2];
+
+ if (name_len > GNAT_MAX_PATH_LEN)
+ return -1;
strcpy (win32_name, name);