Skip to contentSkip to conversation

dso validation check fix

PATCH Applied Maninder Singh 2 participants 2 messages May 6, 2015 – Sep 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dso validation check fix

EP-F6AA0618C49C4AEDA73BFF1B39950BAB
Hi Mark,

dso null pointer check is wrongly placed.

---
 trunk/src/rtld/rtld.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
trunk/src/rtld/rtld.c +2 -2
index 35dfde7..f88ce7f 100644
@@ -479,13 +479,13 @@ find_lib_in_path (struct search_path *path, const char *soname,
       if (wrap_access (ret, F_OK) == 0)
    {
      DSO *dso = open_dso (ret);
+     if (dso == NULL)
+       continue;
           int dso_class = gelf_getclass (dso->elf);
      int dso_machine = (dso_class == ELFCLASS32) ?
                elf32_getehdr (dso->elf)->e_machine :
                elf64_getehdr (dso->elf)->e_machine;
 
-     if (dso == NULL)
-       continue;
 
      /* Skip 32-bit libraries when looking for 64-bit.  Also
         skip libraries for alternative machines.  */

--
1.7.1

Thanks and Regards,
Maninder Singh

Applied
#1 lore raw

Merged to the staging branch.

Quoted 40 lines · Maninder Singh

EP-F6AA0618C49C4AEDA73BFF1B39950BAB
Hi Mark,

dso null pointer check is wrongly placed.

---
 trunk/src/rtld/rtld.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
trunk/src/rtld/rtld.c +2 -3
index 35dfde7..f88ce7f 100644
@@ -479,13 +479,13 @@ find_lib_in_path (struct search_path *path, const char *soname,
       if (wrap_access (ret, F_OK) == 0)
    {
      DSO *dso = open_dso (ret);
+     if (dso == NULL)
+       continue;
           int dso_class = gelf_getclass (dso->elf);
      int dso_machine = (dso_class == ELFCLASS32) ?
                elf32_getehdr (dso->elf)->e_machine :
                elf64_getehdr (dso->elf)->e_machine;
 
-     if (dso == NULL)
-       continue;
 
      /* Skip 32-bit libraries when looking for 64-bit.  Also
         skip libraries for alternative machines.  */
--

1.7.1

Thanks and Regards,
Maninder Singh