summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornils <nils>2007-04-02 20:02:27 +0000
committernils <nils>2007-04-02 20:02:27 +0000
commit6abcc7ea0bff010938c903bfc1ebce02cff3744d (patch)
treee19a5d557ee999be2e787296b0f0b47c5dc4cea1
parent64fde500b7ca1e46a66b0d64f4a83d0abba6b710 (diff)
downloadopenssl-6abcc7ea0bff010938c903bfc1ebce02cff3744d.tar.gz
check if pointer is != NULL before dereferencing it (Coverity CID 40)
-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 f7c08973f..979fca806 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);