aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-07-30 13:47:01 +0000
committerTom Tromey <tromey@gcc.gnu.org>2018-07-30 13:47:01 +0000
commit6ef4752bc90a81600a0a6eb3437c42e02e41b85f (patch)
treea26e950aa4e05c76f631e873d1ccb6b2f8284b13 /libiberty
parentcff431d2d905e25197cf3c471c5131736381ef1d (diff)
downloadgcc-6ef4752bc90a81600a0a6eb3437c42e02e41b85f.zip
gcc-6ef4752bc90a81600a0a6eb3437c42e02e41b85f.tar.gz
gcc-6ef4752bc90a81600a0a6eb3437c42e02e41b85f.tar.bz2
cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.
2018-07-30 Tom Tromey <tom@tromey.com> * cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0. From-SVN: r263069
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/cplus-dem.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index dc5d997..8293fa9 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-30 Tom Tromey <tom@tromey.com>
+
+ * cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.
+
2018-07-26 Martin Liska <mliska@suse.cz>
PR lto/86548
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 6d58bd8..4f29d54 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -4471,7 +4471,8 @@ remember_Btype (struct work_stuff *work, const char *start,
char *tem;
tem = XNEWVEC (char, len + 1);
- memcpy (tem, start, len);
+ if (len > 0)
+ memcpy (tem, start, len);
tem[len] = '\0';
work -> btypevec[index] = tem;
}