diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.c | 9 |
2 files changed, 12 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2006-06-02 Alan Coopersmith <alan.coopersmith@sun.com> + + * parse.c (slookup): + Coverity #925: Pointer "file" dereferenced before NULL check + 2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org> * configure.ac: @@ -429,9 +429,14 @@ struct symtab ** slookup(char *symbol, struct inclist *file) { register int first = 0; - register int last = file->i_ndefs - 1; + register int last; - if (file) while (last >= first) + if (file == NULL) + return NULL; + + last = file->i_ndefs - 1; + + while (last >= first) { /* Fast inline binary search */ register char *s1; |