Fix 'sprintf' of potential NULL pointer in 'maint print arch'
authorJoel Brobecker <brobecker@gnat.com>
Wed, 26 Oct 2011 18:21:38 +0000 (18:21 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 26 Oct 2011 18:21:38 +0000 (18:21 +0000)
gdb/
        * gdbarch.sh (function_list): Use 'pstring' when printing
        'gcore_bfd_target'.
        * gdbarch.c: Regenerate.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.sh

index 5d6087205f16fbc3c362eb67a088f393a3745975..a10d060085a3aefd0b55b1fa94a84e7445653ab1 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-26  Meador Inge  <meadori@codesourcery.com>
+
+       * gdbarch.sh (function_list): Use 'pstring' when printing
+       'gcore_bfd_target'.
+       * gdbarch.c: Regenerate.
+
 2011-10-26  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * regcache.c (registers_changed_ptid): Invalidate thread architecture
index ea48fa7dd0c613420d8a0e44fc26301a55a3d82e..1ada504ca75860a56765ea70d542faf79146f57d 100644 (file)
@@ -953,7 +953,7 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       gdbarch_gcore_bfd_target_p (gdbarch));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gcore_bfd_target = %s\n",
-                      gdbarch->gcore_bfd_target);
+                      pstring (gdbarch->gcore_bfd_target));
   fprintf_unfiltered (file,
                       "gdbarch_dump: gen_return_address = <%s>\n",
                       host_address_to_string (gdbarch->gen_return_address));
index bf78173d33495efdc6c4ac961ce03915aa382e40..a9ca03dff7c9a616419fd6a0d11501e0de2b4bdd 100755 (executable)
@@ -640,7 +640,7 @@ M:LONGEST:core_xfer_shared_libraries:gdb_byte *readbuf, ULONGEST offset, LONGEST
 M:char *:core_pid_to_str:ptid_t ptid:ptid
 
 # BFD target to use when generating a core file.
-V:const char *:gcore_bfd_target:::0:0:::gdbarch->gcore_bfd_target
+V:const char *:gcore_bfd_target:::0:0:::pstring (gdbarch->gcore_bfd_target)
 
 # If the elements of C++ vtables are in-place function descriptors rather
 # than normal function pointers (which may point to code or a descriptor),