This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Do not pass NULL for the string in catch_errors
- From: Luis Machado <luisgpm at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 26 Oct 2015 13:18:58 -0000
- Subject: [binutils-gdb] Do not pass NULL for the string in catch_errors
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7cc53fba0a4e5c316a6e86fdae28f8cc9d0f9a68
commit 7cc53fba0a4e5c316a6e86fdae28f8cc9d0f9a68
Author: Luis Machado <lgustavo@codesourcery.com>
Date: Mon Oct 26 11:17:29 2015 -0200
Do not pass NULL for the string in catch_errors
I caught a segmentation fault while running gdb.reverse/sigall-reverse.exp,
in a mingw32 GDB, in this code path. It boils down to the code trying to
strlen () a NULL pointer. I tracked things down and it looks like
record_full_message_wrapper_safe is the only offender.
gdb/ChangeLog:
2015-10-26 Luis Machado <lgustavo@codesourcery.com>
* record-full.c (record_full_message_wrapper_safe): Pass empty string to
catch_errors call instead of NULL.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/record-full.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f26f233..f653a3d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-26 Luis Machado <lgustavo@codesourcery.com>
+
+ * record-full.c (record_full_message_wrapper_safe): Pass empty string to
+ catch_errors call instead of NULL.
+
2015-10-26 Simon Marchi <simon.marchi@polymtl.ca>
* guile/scm-ports.c (ioscm_make_gdb_stdio_port): Pass non-const
diff --git a/gdb/record-full.c b/gdb/record-full.c
index cd47dfa..595e357 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -667,7 +667,7 @@ record_full_message_wrapper_safe (struct regcache *regcache,
args.regcache = regcache;
args.signal = signal;
- return catch_errors (record_full_message_wrapper, &args, NULL,
+ return catch_errors (record_full_message_wrapper, &args, "",
RETURN_MASK_ALL);
}