summaryrefslogtreecommitdiffstats
path: root/crypto/dso/dso_dlfcn.c
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2007-04-02 22:02:27 +0200
committerNils Larsch <nils@openssl.org>2007-04-02 22:02:27 +0200
commitc971ca4c86b0a7bb4bb7a7d1a3c183b78dfbf144 (patch)
treec4949ecdd2bcf80e35a746dfc5fd96e75d3e43f0 /crypto/dso/dso_dlfcn.c
parentRC4_set_key for x86_64 and Core2 optimization. (diff)
downloadopenssl-c971ca4c86b0a7bb4bb7a7d1a3c183b78dfbf144.tar.xz
openssl-c971ca4c86b0a7bb4bb7a7d1a3c183b78dfbf144.zip
check if pointer is != NULL before dereferencing it (Coverity CID 40)
Diffstat (limited to 'crypto/dso/dso_dlfcn.c')
-rw-r--r--crypto/dso/dso_dlfcn.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index f7c08973f4..979fca8065 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -296,13 +296,12 @@ static char *dlfcn_merger(DSO *dso, const char *filespec1,
}
/* If the first file specification is a rooted path, it rules.
same goes if the second file specification is missing. */
- if (!filespec2 || filespec1[0] == '/')
+ if (!filespec2 || (filespec1 != NULL && filespec1[0] == '/'))
{
merged = OPENSSL_malloc(strlen(filespec1) + 1);
if(!merged)
{
- DSOerr(DSO_F_DLFCN_MERGER,
- ERR_R_MALLOC_FAILURE);
+ DSOerr(DSO_F_DLFCN_MERGER, ERR_R_MALLOC_FAILURE);
return(NULL);
}
strcpy(merged, filespec1);