mi/mi-cmd-break.c: Use xsnprintf instead of sprintf (ARI fix)
authorJoel Brobecker <brobecker@gnat.com>
Thu, 23 May 2013 06:39:42 +0000 (06:39 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 23 May 2013 06:39:42 +0000 (06:39 +0000)
gdb/ChangeLog:

        * mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
        of sprintf.

gdb/ChangeLog
gdb/mi/mi-cmd-break.c

index 9ca55d7f81f2aaa004dd237e9e1254f919dab92a..1c21cd46689dc44448c1a9cdac830aba8b974de6 100644 (file)
@@ -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
index 050cf3f3c02d3049b326c3b7434a5501981cf23f..87ccee743f8131e3cd9181328c046b1c0eaf12f3 100644 (file)
@@ -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;