summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-06-26 21:36:44 -0400
committerRich Felker <dalias@aerifal.cx>2011-06-26 21:36:44 -0400
commit0e4dae3d77f67bed0cd29c98b67b86c7d9853ac9 (patch)
tree412b978f832b9f8547c3549cbf4be7ddf1cac282 /src
parent92ab5d8d156545ab0daff6062d7a519861684fb6 (diff)
downloadmusl-0e4dae3d77f67bed0cd29c98b67b86c7d9853ac9.tar.gz
musl-0e4dae3d77f67bed0cd29c98b67b86c7d9853ac9.tar.bz2
musl-0e4dae3d77f67bed0cd29c98b67b86c7d9853ac9.tar.xz
musl-0e4dae3d77f67bed0cd29c98b67b86c7d9853ac9.zip
in dlopen: don't use null pointer
deps can be null if a library has no dependencies (such as libc itself)
Diffstat (limited to 'src')
-rw-r--r--src/ldso/dynlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 305d70e0..a23390e1 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -514,19 +514,19 @@ void *dlopen(const char *file, int mode)
/* First load handling */
if (!p->deps) {
load_deps(p);
- for (i=0; p->deps[i]; i++)
+ if (p->deps) for (i=0; p->deps[i]; i++)
if (!p->deps[i]->global)
p->deps[i]->global = -1;
if (!p->global) p->global = -1;
reloc_all(p);
- for (i=0; p->deps[i]; i++)
+ if (p->deps) for (i=0; p->deps[i]; i++)
if (p->deps[i]->global < 0)
p->deps[i]->global = 0;
if (p->global < 0) p->global = 0;
}
if (mode & RTLD_GLOBAL) {
- for (i=0; p->deps[i]; i++)
+ if (p->deps) for (i=0; p->deps[i]; i++)
p->deps[i]->global = 1;
p->global = 1;
}