public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add explicit check for nullptr to target_announce_attach
@ 2022-01-08 16:47 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-01-08 16:47 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=249f1cf8e669cc2fa7832601e0bbf460c5bfb97d
commit 249f1cf8e669cc2fa7832601e0bbf460c5bfb97d
Author: Tom Tromey <tom@tromey.com>
Date: Sat Jan 8 09:45:27 2022 -0700
Add explicit check for nullptr to target_announce_attach
Lancelot pointed out that target_announce_attach was missing an
explicit check against nullptr. This patch adds it.
Diff:
---
gdb/target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/target.c b/gdb/target.c
index c25ce692538..950f2f08e31 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3648,7 +3648,7 @@ target_announce_attach (int from_tty, int pid)
const char *exec_file = get_exec_file (0);
- if (exec_file)
+ if (exec_file != nullptr)
printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
target_pid_to_str (ptid_t (pid)).c_str ());
else
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-08 16:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08 16:47 [binutils-gdb] Add explicit check for nullptr to target_announce_attach Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).