Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch][gdb] Fix crashes in bz24364
@ 2019-06-17 14:42 Paul Pluzhnikov via gdb-patches
  2019-06-17 17:39 ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Pluzhnikov via gdb-patches @ 2019-06-17 14:42 UTC (permalink / raw)
  To: gdb-patches ml

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

This is somewhat on the obvious side.

Fix all crashes from bz24364.

gdb/ChangeLog

        PR gdb/24364
        * gdb/dtrace-probe.c (dtrace_static_probe_ops::get_probe): Don't
        call dtrace_process_dof with NULL dof.


-- 
Paul Pluzhnikov

[-- Attachment #2: gdb-bz24364-20190617.txt --]
[-- Type: text/plain, Size: 826 bytes --]

diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 52973784e9..2a2eae1f70 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -856,13 +856,14 @@ dtrace_static_probe_ops::get_probes
 
 	  /* Read the contents of the DOF section and then process it to
 	     extract the information of any probe defined into it.  */
-	  if (!bfd_malloc_and_get_section (abfd, sect, &dof))
+	  if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
+	    dtrace_process_dof (sect, objfile, probesp,
+			        (struct dtrace_dof_hdr *) dof);
+         else
 	    complaint (_("could not obtain the contents of"
 			 "section '%s' in objfile `%s'."),
 		       sect->name, abfd->filename);
-      
-	  dtrace_process_dof (sect, objfile, probesp,
-			      (struct dtrace_dof_hdr *) dof);
+
 	  xfree (dof);
 	}
     }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-17 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 14:42 [patch][gdb] Fix crashes in bz24364 Paul Pluzhnikov via gdb-patches
2019-06-17 17:39 ` Tom Tromey
2019-06-17 19:32   ` Simon Marchi
2019-06-17 20:57     ` Paul Pluzhnikov via gdb-patches
2019-06-17 21:08       ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox