summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_ciph.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-05-26 20:20:51 +0000
committermiod <miod@openbsd.org>2014-05-26 20:20:51 +0000
commita65bc73f9c41f5f5731bbd6c3e9c7adc3bb8f5f2 (patch)
treee748249c657c7bf07eb66cd02193c49c41d39df3 /lib/libssl/ssl_ciph.c
parentWe don't really to keep history in constructs such as: (diff)
downloadwireguard-openbsd-a65bc73f9c41f5f5731bbd6c3e9c7adc3bb8f5f2.tar.xz
wireguard-openbsd-a65bc73f9c41f5f5731bbd6c3e9c7adc3bb8f5f2.zip
Unchecked malloc() return value in SSL_COMP_add_compression_method(), in the
!OPENSSL_NO_COMP case. Does not affect OpenBSD as we compile the opposite code path.
Diffstat (limited to 'lib/libssl/ssl_ciph.c')
-rw-r--r--lib/libssl/ssl_ciph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libssl/ssl_ciph.c b/lib/libssl/ssl_ciph.c
index 6b650ccea3b..b2a1e93688c 100644
--- a/lib/libssl/ssl_ciph.c
+++ b/lib/libssl/ssl_ciph.c
@@ -1737,6 +1737,10 @@ SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
MemCheck_off();
comp = malloc(sizeof(SSL_COMP));
+ if (comp == NULL) {
+ SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD, ERR_R_MALLOC_FAILURE);
+ return (1);
+ }
comp->id = id;
comp->method = cm;
load_builtin_compressions();