[elf] Fix possible null-pointer dereference.
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
This issue was found by SVACE static analyzer.
Dereference can appear at line 2223 and there are no
obvious checks of `name` ptr value.
Jump to label `no_file` from elf/dl-load.c:2066
can trigger it.
---
elf/dl-load.c | 1 +
1 file changed, 1 insertion(+)
@@ -2271,6 +2271,7 @@ _dl_map_object (struct link_map *loader, const char *name,
have. */
static const Elf_Symndx dummy_bucket = STN_UNDEF;
+ assert(name != NULL);
/* Allocate a new object map. */
if ((name_copy = __strdup (name)) == NULL
|| (l = _dl_new_object (name_copy, name, type, loader,