patch-libiberty_cp-demangle_c 670 B

12345678910111213141516171819202122
  1. $OpenBSD: patch-libiberty_cp-demangle_c,v 1.1 2012/01/26 13:17:22 pascal Exp $
  2. --- libiberty/cp-demangle.c.orig Wed Jan 25 10:50:45 2012
  3. +++ libiberty/cp-demangle.c Wed Jan 25 10:54:17 2012
  4. @@ -3409,7 +3409,7 @@ static inline void
  5. d_append_num (struct d_print_info *dpi, long l)
  6. {
  7. char buf[25];
  8. - sprintf (buf,"%ld", l);
  9. + snprintf (buf, 25, "%ld", l);
  10. d_append_string (dpi, buf);
  11. }
  12. @@ -5015,7 +5015,7 @@ __cxa_demangle (const char *mangled_name, char *output
  13. {
  14. if (strlen (demangled) < *length)
  15. {
  16. - strcpy (output_buffer, demangled);
  17. + strlcpy (output_buffer, demangled, *length);
  18. free (demangled);
  19. demangled = output_buffer;
  20. }