From a1690688cee19199afb1fb44da4546750be622cc Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 17 May 2006 05:28:36 +0000 Subject: [PATCH] Don't crash if ->modules is NULL. --- libdwfl/ChangeLog | 5 +++++ libdwfl/dwfl_addrmodule.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 1f75d6bf9..d78194aab 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2006-05-16 Ulrich Drepper + + * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of + ->modules is NULL. + 2006-02-26 Roland McGrath * dwfl_version.c: New file. diff --git a/libdwfl/dwfl_addrmodule.c b/libdwfl/dwfl_addrmodule.c index bd95a87fa..98c4b39fd 100644 --- a/libdwfl/dwfl_addrmodule.c +++ b/libdwfl/dwfl_addrmodule.c @@ -1,5 +1,5 @@ /* Find module containing address. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2006 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -52,7 +52,7 @@ Dwfl_Module * dwfl_addrmodule (Dwfl *dwfl, Dwarf_Addr address) { - if (dwfl == NULL) + if (dwfl == NULL || dwfl->modules == NULL) return NULL; /* Do binary search on the array indexed by module load address. */ -- 2.47.2