This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/35483] GCC on AIX doesn't support dollar in symbols name.



------- Comment #6 from dje at gcc dot gnu dot org  2008-10-02 21:30 -------
+  strip = (char *)ggc_alloc_string (name, len);
+
+  for (len = 0; name[len]; len++)
+    if (name[len] == '$')
+      strip[len] = '_';
+    else
+      strip[len] = name[len];
+  strip[len] = 0;
+
+  return strip;

It is not safe to edit a ggc_alloc_string-allocated string in place.  This
should be

+  strip = (char *)alloca (name, len);
...
+  return ggc_alloc_string  (strip, len);

Also, using fixed-size 256 byte buffers is not safe because they can overflow.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35483


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]