aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-07-31 22:31:39 +0000
committerJeff Law <law@gcc.gnu.org>2014-07-31 16:31:39 -0600
commite3cb8f057f86a67e6e1adf8aeeb4f9aa536d3e4e (patch)
tree10ba22afa842800f5d394ffd9e9980ebf28f2176
parentf3d95c690319417f53de95fadffee696a655b468 (diff)
downloadgcc-e3cb8f057f86a67e6e1adf8aeeb4f9aa536d3e4e.zip
gcc-e3cb8f057f86a67e6e1adf8aeeb4f9aa536d3e4e.tar.gz
gcc-e3cb8f057f86a67e6e1adf8aeeb4f9aa536d3e4e.tar.bz2
* gcc.c (do_spec_1): Allocate enough space for saved_suffix.
From-SVN: r213387
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/gcc.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 706fedc..b64b5ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2014-07-31 Chen Gang <gang.chen.5i5j@gmail.com>
+
+ * gcc.c (do_spec_1): Allocate enough space for saved_suffix.
+
2014-07-31 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/arm_neon.h (vpadd_<suf><8,16,32,64>): Move to
diff --git a/gcc/gcc.c b/gcc/gcc.c
index c0fde8c..44d0416 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -4894,7 +4894,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
saved_suffix
= XNEWVEC (char, suffix_length
- + strlen (TARGET_OBJECT_SUFFIX));
+ + strlen (TARGET_OBJECT_SUFFIX) + 1);
strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length,
TARGET_OBJECT_SUFFIX);