openbsd-ports/lang/gcc/4.6/patches/patch-libiberty_cp-demangle_c
pascal be59426cab - bump libestdc++ following the bump in gcc 4.2
- deal with ldconfig shitz being run at fake install everywhere
- fix sprintf/strcpy usage in libestdc++ so we don't get a warning every time
  we compile a C++ program

Everything brought up by espie@.
2012-01-26 13:17:22 +00:00

22 lines
670 B
Plaintext

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