From f52df7d9b76f8efc9048db80102607178896ee75 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Wed, 25 Jul 2007 02:12:33 +0000 Subject: [PATCH] 2007-07-23 Michael Snyder * solib-svr4.c (svr4_fetch_objfile_link_map): Null pointer check of 'buffer' must cover both branches that call strcmp (Coverity). --- gdb/ChangeLog | 7 ++++--- gdb/solib-svr4.c | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b4573836a47..27c3b36c3e5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,8 +1,9 @@ -2007-07-05 Michael Snyder +2007-07-24 Michael Snyder - * stack.c (print_frame_args): Check return value of lookup_symbol. + * solib-svr4.c (svr4_fetch_objfile_link_map): Null pointer check of + 'buffer' must cover both branches that call strcmp (Coverity). -2007-07-24 Michael Snyder + * stack.c (print_frame_args): Check return value of lookup_symbol. * ax-gdb.c (find_field): Guard against null ptr. diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 1ef2d1e06cb..fc608de79f4 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; -- 2.30.2