diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2011-11-11 18:31:47 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2011-11-11 18:31:47 +0200 |
commit | ee66e604c3804ffb22c405972a2d0009bc10b969 (patch) | |
tree | f308511d02850fbca85c74725880acfa7b43040d /libgfortran/runtime/main.c | |
parent | 13ced9bb885c265f5ba108265e593a18bb666eb0 (diff) | |
download | gcc-ee66e604c3804ffb22c405972a2d0009bc10b969.zip gcc-ee66e604c3804ffb22c405972a2d0009bc10b969.tar.gz gcc-ee66e604c3804ffb22c405972a2d0009bc10b969.tar.bz2 |
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.
From-SVN: r181288
Diffstat (limited to 'libgfortran/runtime/main.c')
-rw-r--r-- | libgfortran/runtime/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c index bc8dab4..6ce5388 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; |