summaryrefslogtreecommitdiffstats
path: root/crypto/comp
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2005-12-02 13:27:19 +0000
committerDr. Stephen Henson <steve@openssl.org>2005-12-02 13:27:19 +0000
commitda5a0e8722077ab0621c77515fd634345f43ac11 (patch)
treefda17e6fbfade74321946e83f5961d3c1b4a2f7d /crypto/comp
parent200fc028482d1f2b61f279a84a34001b3e1edd62 (diff)
Add error checking to avoid crashing when zlib cannot be loaded.
Diffstat (limited to 'crypto/comp')
-rw-r--r--crypto/comp/c_zlib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index 8263f7315d..e077aa5b91 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -397,13 +397,18 @@ COMP_METHOD *COMP_zlib(void)
p_deflateInit_
= (deflateInit__ft) DSO_bind_func(zlib_dso,
"deflateInit_");
- zlib_loaded++;
+
+ if (p_compress && p_inflateEnd && p_inflate
+ && p_inflateInit_ && p_deflateEnd
+ && p_deflate && p_deflateInit_)
+ zlib_loaded++;
}
}
#endif
#if defined(ZLIB) || defined(ZLIB_SHARED)
- meth = &zlib_stateful_method;
+ if (zlib_loaded)
+ meth = &zlib_stateful_method;
#endif
return(meth);