Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Paul Pluzhnikov via gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [patch][gdb] Fix crashes in bz24364
Date: Mon, 17 Jun 2019 14:42:00 -0000	[thread overview]
Message-ID: <CALoOobOmJyDjMSDJ0EX3SGLago7vUKHbZw2KnsAo6VpjrTBh3g@mail.gmail.com> (raw)

[-- 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);
 	}
     }

             reply	other threads:[~2019-06-17 14:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 14:42 Paul Pluzhnikov via gdb-patches [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALoOobOmJyDjMSDJ0EX3SGLago7vUKHbZw2KnsAo6VpjrTBh3g@mail.gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox