]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb, remote: fix notify debug nullptr dereference
authorMarkus Metzger <markus.t.metzger@intel.com>
Tue, 10 Mar 2026 05:44:18 +0000 (05:44 +0000)
committerMarkus Metzger <markus.t.metzger@intel.com>
Mon, 11 May 2026 07:00:19 +0000 (07:00 +0000)
In remote_target:push_stop_reply, notif debug prints an element that has
been moved.  Print the element at the destination, instead.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/remote.c

index 1455838c2cf337a28fca11d2e3a514e0c7ff7371..735774903f3f094bed29c540f3a19a6e6f45aecc 100644 (file)
@@ -8406,7 +8406,7 @@ remote_target::push_stop_reply (stop_reply_up new_event)
   if (notif_debug)
     gdb_printf (gdb_stdlog,
                "notif: push 'Stop' %s to queue %d\n",
-               new_event->ptid.to_string ().c_str (),
+               rs->stop_reply_queue.back ()->ptid.to_string ().c_str (),
                int (rs->stop_reply_queue.size ()));
 
   /* Mark the pending event queue only if async mode is currently enabled.