diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-02 19:04:39 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-02 19:04:39 +0000 |
commit | 329cbab59d9bb1bfbfc5f7ff268456618474d51f (patch) | |
tree | 8e1c4102d3c40d7527e0ec7628300736d8e0be8b | |
parent | 5b69e2e1d49009faa029ccc3f7c54af76105e30b (diff) | |
download | gcc-329cbab59d9bb1bfbfc5f7ff268456618474d51f.tar.gz |
gcc/
* collect2.c (ignore_library): Avoid premature post-increment
and null deference.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148095 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/collect2.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26a6edd13d4..d56760b6d8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com> + * collect2.c (ignore_library): Avoid premature post-increment + and null deference. + +2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com> + * Makefile.in (libgcc.mvars): Add TARGET_SYSTEM_ROOT. * config/rs6000/aix.h (LINK_SYSCALLS_SPEC): Add %R to the !CROSS_DIRECTORY_STRUCTURE alternative and use it for diff --git a/gcc/collect2.c b/gcc/collect2.c index d15a81af182..a500147e563 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2448,9 +2448,11 @@ static int ignore_library (const char *); static int ignore_library (const char *name) { - const char *const *p = &aix_std_libs[0]; - while (*p++ != NULL) - if (! strcmp (name, *p)) return 1; + const char *const *p; + + for (p = &aix_std_libs[0]; *p != NULL; ++p) + if (strcmp (name, *p) == 0) + return 1; return 0; } #endif /* COLLECT_EXPORT_LIST */ |