From ce70887aa8d17bd4acf188f4ebade9cd2717acef Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 23 May 2013 06:39:42 +0000 Subject: [PATCH] mi/mi-cmd-break.c: Use xsnprintf instead of sprintf (ARI fix) gdb/ChangeLog: * mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead of sprintf. --- gdb/ChangeLog | 5 +++++ gdb/mi/mi-cmd-break.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9ca55d7f81f..1c21cd46689 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-05-23 Joel Brobecker + + * mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead + of sprintf. + 2013-05-22 Keith Seitz * ada-lang.c (is_known_support_routine): Add explicit free of diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index 050cf3f3c02..87ccee743f8 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -135,7 +135,8 @@ mi_argv_to_format (char **argv, int argc) { char tmp[5]; - sprintf (tmp, "\\%o", (unsigned char) argv[0][i]); + xsnprintf (tmp, sizeof (tmp), "\\%o", + (unsigned char) argv[0][i]); obstack_grow (&obstack, tmp, strlen (tmp)); } break; -- 2.30.2