diff options
author | Michael Snyder <msnyder@vmware.com> | 2007-07-25 02:12:33 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2007-07-25 02:12:33 +0000 |
commit | f52df7d9b76f8efc9048db80102607178896ee75 (patch) | |
tree | 263eb0e06db2cf008b26470495e19b27b2dc237e /gdb/solib-svr4.c | |
parent | 55765a25f62ac4a16bf1ed5729da7ee45128e869 (diff) | |
download | gdb-f52df7d9b76f8efc9048db80102607178896ee75.zip gdb-f52df7d9b76f8efc9048db80102607178896ee75.tar.gz gdb-f52df7d9b76f8efc9048db80102607178896ee75.tar.bz2 |
2007-07-23 Michael Snyder <msnyder@access-company.com>
* solib-svr4.c (svr4_fetch_objfile_link_map): Null pointer check of
'buffer' must cover both branches that call strcmp (Coverity).
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r-- | gdb/solib-svr4.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 1ef2d1e..fc608de 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -839,8 +839,11 @@ svr4_fetch_objfile_link_map (struct objfile *objfile) /* Is this the linkmap for the file we want? */ /* If the file is not a shared library and has no name, we are sure it is the main executable, so we return that. */ - if ((buffer && strcmp (buffer, objfile->name) == 0) - || (!(objfile->flags & OBJF_SHARED) && (strcmp (buffer, "") == 0))) + + if (buffer + && ((strcmp (buffer, objfile->name) == 0) + || (!(objfile->flags & OBJF_SHARED) + && (strcmp (buffer, "") == 0)))) { do_cleanups (old_chain); return lm; |