diff options
author | DJ Delorie <dj@redhat.com> | 2024-11-06 21:40:35 -0500 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2024-11-07 13:31:24 -0500 |
commit | 8e572067976ea700e5ef750458c42c47328fe459 (patch) | |
tree | b0a0b7cc51e0cb8327ea73ed55795b3d3c5e3827 /elf/dl-load.c | |
parent | 12b8dd77182420917a8efdaca03a5e3d77a127f5 (diff) | |
download | glibc-8e572067976ea700e5ef750458c42c47328fe459.zip glibc-8e572067976ea700e5ef750458c42c47328fe459.tar.gz glibc-8e572067976ea700e5ef750458c42c47328fe459.tar.bz2 |
elf: avoid jumping over a needed declaration
The declaration of found_other_class could be jumped
over via the goto just above it, but the code jumped
to uses found_other_class. Move the declaration
up a bit to ensure it's properly declared and initialized.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r-- | elf/dl-load.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c index ac8e217..335b34c 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1931,6 +1931,9 @@ _dl_map_object (struct link_map *loader, const char *name, : "\nfile=%s [%lu]; dynamically loaded by %s [%lu]\n", name, nsid, DSO_FILENAME (loader->l_name), loader->l_ns); + /* Will be true if we found a DSO which is of the other ELF class. */ + bool found_other_class = false; + #ifdef SHARED /* Give the auditing libraries a chance to change the name before we try anything. */ @@ -1948,9 +1951,6 @@ _dl_map_object (struct link_map *loader, const char *name, } #endif - /* Will be true if we found a DSO which is of the other ELF class. */ - bool found_other_class = false; - if (strchr (name, '/') == NULL) { /* Search for NAME in several places. */ |