]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.
authorTom Tromey <tom@tromey.com>
Mon, 30 Jul 2018 13:47:01 +0000 (13:47 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 30 Jul 2018 13:47:01 +0000 (13:47 +0000)
2018-07-30  Tom Tromey  <tom@tromey.com>

* cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.

From-SVN: r263069

libiberty/ChangeLog
libiberty/cplus-dem.c

index dc5d9971f68e0c5a7339aefe856c8a29161768d0..8293fa9ac56f7166fc79139f5bfb67fb660f3b0f 100644 (file)
@@ -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
index 6d58bd899bf7d21144216db24d63376811d688fe..4f29d54d089783e137c4dfb77d2e8631ad5d0b6a 100644 (file)
@@ -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;
 }