diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-06-28 20:54:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-06-28 20:54:04 +0000 |
commit | 94e12bd4d9b7de6cc4a084c7b453a0e26210f56e (patch) | |
tree | ae65c319bfeb98b4332946ac7f27375be3ba4e03 /libgo/runtime/go-caller.c | |
parent | eacb16dc798d06acfb9741a2496584ab0728257a (diff) | |
download | gcc-94e12bd4d9b7de6cc4a084c7b453a0e26210f56e.zip gcc-94e12bd4d9b7de6cc4a084c7b453a0e26210f56e.tar.gz gcc-94e12bd4d9b7de6cc4a084c7b453a0e26210f56e.tar.bz2 |
runtime: don't stat a NULL filename
Noticed in https://gcc.gnu.org/PR86331.
Reviewed-on: https://go-review.googlesource.com/121417
From-SVN: r262234
Diffstat (limited to 'libgo/runtime/go-caller.c')
-rw-r--r-- | libgo/runtime/go-caller.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c index 6b26ddc..7f36955 100644 --- a/libgo/runtime/go-caller.c +++ b/libgo/runtime/go-caller.c @@ -116,7 +116,7 @@ __go_get_backtrace_state () argv[0] (http://gcc.gnu.org/PR61895). It would be nice to have a better check for whether this file is the real executable. */ - if (stat (filename, &s) < 0 || s.st_size < 1024) + if (filename != NULL && (stat (filename, &s) < 0 || s.st_size < 1024)) filename = NULL; back_state = backtrace_create_state (filename, 1, error_callback, NULL); |