about summary refs log tree commit diff
path: root/elf/dl-deps.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-deps.c')
-rw-r--r--elf/dl-deps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index d59f53658d..fca210f72a 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -465,7 +465,7 @@ _dl_map_object_deps (struct link_map *map,
 
   /* Store the search list we built in the object.  It will be used for
      searches in the scope of this object.  */
-  map->l_searchlist.r_list = malloc ((2 * nlist
+  map->l_searchlist.r_list = malloc ((2 * nlist + 1
 				      + (nlist == nduplist ? 0 : nduplist))
 				     * sizeof (struct link_map *));
   if (map->l_searchlist.r_list == NULL)
@@ -549,4 +549,6 @@ _dl_map_object_deps (struct link_map *map,
 	    }
 	}
     }
+  /* Terminate the list of dependencies.  */
+  map->l_initfini[nlist] = NULL;
 }