]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Don't crash if ->modules is NULL.
authorUlrich Drepper <drepper@redhat.com>
Wed, 17 May 2006 05:28:36 +0000 (05:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 17 May 2006 05:28:36 +0000 (05:28 +0000)
libdwfl/ChangeLog
libdwfl/dwfl_addrmodule.c

index 1f75d6bf9cf527ca215a26254aa1154b4b55ea89..d78194aab74061c8b94bb9b7b61aa90bc20a60b9 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-16  Ulrich Drepper  <drepper@redhat.com>
+
+       * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
+       ->modules is NULL.
+
 2006-02-26  Roland McGrath  <roland@redhat.com>
 
        * dwfl_version.c: New file.
index bd95a87fa0b1d22866861b10a9b3845d573bd31c..98c4b39fd3170b777285c7ba57b7861f81c71a62 100644 (file)
@@ -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.  */