mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
dtoolutil: Fix UB when musl's dlinfo(RTLD_DI_LINKMAP) fails
This commit is contained in:
parent
adaf9ee4aa
commit
f21830d2a8
@ -610,8 +610,7 @@ read_args() {
|
|||||||
#else
|
#else
|
||||||
void *self = dlopen(NULL, RTLD_NOW | RTLD_NOLOAD);
|
void *self = dlopen(NULL, RTLD_NOW | RTLD_NOLOAD);
|
||||||
#endif
|
#endif
|
||||||
dlinfo(self, RTLD_DI_LINKMAP, &map);
|
if (dlinfo(self, RTLD_DI_LINKMAP, &map)) {
|
||||||
|
|
||||||
while (map != nullptr) {
|
while (map != nullptr) {
|
||||||
const char *tail = strrchr(map->l_name, '/');
|
const char *tail = strrchr(map->l_name, '/');
|
||||||
const char *head = strchr(map->l_name, '/');
|
const char *head = strchr(map->l_name, '/');
|
||||||
@ -622,6 +621,7 @@ read_args() {
|
|||||||
map = map->l_next;
|
map = map->l_next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_PROC_SELF_MAPS) || defined(HAVE_PROC_CURPROC_MAP)
|
#if defined(HAVE_PROC_SELF_MAPS) || defined(HAVE_PROC_CURPROC_MAP)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user