aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2015-08-31 11:19:42 +0000
committerRainer Orth <ro@gcc.gnu.org>2015-08-31 11:19:42 +0000
commitc25eec8ffd8605d473192faec7ef11b9abf7a10b (patch)
treee12e06159f67f67e7d07480f35337fc48470fa07 /gcc
parentcd55d18e5da549f75cc2ae0bbfb69aa232753c19 (diff)
downloadgcc-c25eec8ffd8605d473192faec7ef11b9abf7a10b.zip
gcc-c25eec8ffd8605d473192faec7ef11b9abf7a10b.tar.gz
gcc-c25eec8ffd8605d473192faec7ef11b9abf7a10b.tar.bz2
Avoid strndup in gcc.c (PR bootstrap/67363)
PR bootstrap/67363 * gcc.c (env_manager::xput): Replace strndup by xstrndup. From-SVN: r227337
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gcc.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a0123b1..88ccb22 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR bootstrap/67363
+ * gcc.c (env_manager::xput): Replace strndup by xstrndup.
+
2015-08-31 Tom de Vries <tom@codesourcery.com>
* tree-ssa-loop-manip.c (find_uses_to_rename_use)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 86c2419..757bfc9 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -123,7 +123,7 @@ env_manager::xput (const char *string)
gcc_assert (equals);
struct kv kv;
- kv.m_key = strndup (string, equals - string);
+ kv.m_key = xstrndup (string, equals - string);
const char *cur_value = ::getenv (kv.m_key);
if (m_debug)
fprintf (stderr, "saving old value: %s\n",cur_value);