aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/read.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d00fb87..001af54 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2020-02-26 Alan Modra <amodra@gmail.com>
+ * read.c (read_a_source_file): Call strncpy with length one
+ less than size of original_case_string.
+
+2020-02-26 Alan Modra <amodra@gmail.com>
+
* config/obj-elf.c: Indent labels correctly.
* config/obj-macho.c: Likewise.
* config/tc-aarch64.c: Likewise.
diff --git a/gas/read.c b/gas/read.c
index e603099..784d6a8 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1052,7 +1052,8 @@ read_a_source_file (const char *name)
{
char *s2 = s;
- strncpy (original_case_string, s2, sizeof (original_case_string));
+ strncpy (original_case_string, s2,
+ sizeof (original_case_string) - 1);
original_case_string[sizeof (original_case_string) - 1] = 0;
while (*s2)