about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-10 00:08:55 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-10 00:08:55 +0000
commit9363dbb847a7e29d1abfffabc59fb142cf956df2 (patch)
treeea4d5ac2f687da1c4797ad25ef42192ac5472b68 /elf
parent96c2836f06a3dc72cd47c1b1604a3707fee00bdc (diff)
downloadglibc-9363dbb847a7e29d1abfffabc59fb142cf956df2.tar.gz
glibc-9363dbb847a7e29d1abfffabc59fb142cf956df2.tar.xz
glibc-9363dbb847a7e29d1abfffabc59fb142cf956df2.zip
Update.
	* elf/dl-lookup.c (_dl_lookup_symbol_x): Fix possible NULL pointer
	derefernce in error message.  Pretty printing.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-lookup.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index b05404f815..88ac67ae1e 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -279,7 +279,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
 	  && skip_map == NULL)
 	{
 	  /* We could find no value for a strong reference.  */
-	  const char *reference_name = undef_map ? undef_map->l_name : NULL;
+	  const char *reference_name = undef_map ? undef_map->l_name : "";
 	  const char *versionstr = version ? ", version " : "";
 	  const char *versionname = (version && version->name
 				     ? version->name : "");
@@ -313,14 +313,13 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
 	{
 	  struct sym_val protected_value = { NULL, NULL };
 
-	  for (scope = symbol_scope; *scope; i = 0, ++scope)
+	  for (scope = symbol_scope; *scope != NULL; i = 0, ++scope)
 	    if (do_lookup_x (undef_name, hash, *ref, &protected_value,
 			     *scope, i, version, flags, skip_map,
 			     ELF_RTYPE_CLASS_PLT) != 0)
 	      break;
 
-	  if (protected_value.s != NULL
-	      && protected_value.m != undef_map)
+	  if (protected_value.s != NULL && protected_value.m != undef_map)
 	    {
 	      current_value.s = *ref;
 	      current_value.m = undef_map;