aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-05-23 06:39:42 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-05-23 06:39:42 +0000
commitce70887aa8d17bd4acf188f4ebade9cd2717acef (patch)
tree43db7474d80c3287bc263d59ddbef7a1e219731b
parent0201faace78ad7fb4eb26e405a95e62db267543e (diff)
downloadgdb-ce70887aa8d17bd4acf188f4ebade9cd2717acef.zip
gdb-ce70887aa8d17bd4acf188f4ebade9cd2717acef.tar.gz
gdb-ce70887aa8d17bd4acf188f4ebade9cd2717acef.tar.bz2
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/mi/mi-cmd-break.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9ca55d7..1c21cd4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-23 Joel Brobecker <brobecker@adacore.com>
+
+ * mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
+ of sprintf.
+
2013-05-22 Keith Seitz <keiths@redhat.com>
* 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 050cf3f..87ccee7 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;