diff options
author | Nick Clifton <nickc@redhat.com> | 2003-02-21 12:42:56 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-02-21 12:42:56 +0000 |
commit | 887933998adad12398f8e99bb484a894552f86f8 (patch) | |
tree | 4ee728534bfb20aaaf5ab91a1968b8dbda7a9516 /gprof/corefile.c | |
parent | 77c6dd379a89e709d456acbe0623eb657279313b (diff) | |
download | gdb-887933998adad12398f8e99bb484a894552f86f8.zip gdb-887933998adad12398f8e99bb484a894552f86f8.tar.gz gdb-887933998adad12398f8e99bb484a894552f86f8.tar.bz2 |
Check for a NULL sentinel value before using it.
Diffstat (limited to 'gprof/corefile.c')
-rw-r--r-- | gprof/corefile.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gprof/corefile.c b/gprof/corefile.c index 4b8fa13..039fb82 100644 --- a/gprof/corefile.c +++ b/gprof/corefile.c @@ -1,6 +1,6 @@ /* corefile.c - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -736,13 +736,16 @@ core_create_line_syms (cbfd) /* Update sentinels. */ sentinel = sym_lookup (&symtab, (bfd_vma) 0); - if (strcmp (sentinel->name, "<locore>") == 0 + if (sentinel + && strcmp (sentinel->name, "<locore>") == 0 && min_vma <= sentinel->end_addr) sentinel->end_addr = min_vma - 1; sentinel = sym_lookup (&symtab, ~(bfd_vma) 0); - if (strcmp (sentinel->name, "<hicore>") == 0 && max_vma >= sentinel->addr) + if (sentinel + && strcmp (sentinel->name, "<hicore>") == 0 + && max_vma >= sentinel->addr) sentinel->addr = max_vma + 1; /* Copy in function symbols. */ |