summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-11 16:31:47 +0000
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-11 16:31:47 +0000
commit4670020b7c4d225e27eba498caf5d4dc75b3be37 (patch)
treef308511d02850fbca85c74725880acfa7b43040d /libgfortran/runtime
parent58974e7878ca6acff733dda44e216904c01dc20e (diff)
downloadgcc-4670020b7c4d225e27eba498caf5d4dc75b3be37.tar.gz
PR 51090 Check that getenv result != NULL before proceeding.
2011-11-11 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/51090 * runtime/main.c (find_addr2line): NULL check before proceeding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c
index bc8dab449e8..6ce5388c6f4 100644
--- a/libgfortran/runtime/main.c
+++ b/libgfortran/runtime/main.c
@@ -149,6 +149,8 @@ find_addr2line (void)
#ifdef HAVE_ACCESS
#define A2L_LEN 10
char *path = getenv ("PATH");
+ if (!path)
+ return;
size_t n = strlen (path);
char ap[n + 1 + A2L_LEN];
size_t ai = 0;