Have load_buildtin_compression in ssl/ssl_ciph.c return RUN_ONCE result
authorRichard Levitte <levitte@openssl.org>
Wed, 20 Jul 2016 15:52:35 +0000 (17:52 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 22 Jul 2016 09:56:45 +0000 (11:56 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/ssl_ciph.c

index 2a54f9d44d2a04ceba7fa32ca4085e86383cebf8..2f036c324fa400fb7ee004167fe71be0a970103a 100644 (file)
@@ -502,9 +502,9 @@ DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)
     return 1;
 }
 
-static void load_builtin_compressions(void)
+static int load_builtin_compressions(void)
 {
-    RUN_ONCE(&ssl_load_builtin_comp_once, do_load_builtin_compressions);
+    return RUN_ONCE(&ssl_load_builtin_comp_once, do_load_builtin_compressions);
 }
 #endif
 
@@ -521,7 +521,12 @@ int ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc,
     if (comp != NULL) {
         SSL_COMP ctmp;
 #ifndef OPENSSL_NO_COMP
-        load_builtin_compressions();
+        if (!load_builtin_compressions()) {
+            /*
+             * Currently don't care, since a failure only means that
+             * ssl_comp_methods is NULL, which is perfectly OK
+             */
+        }
 #endif
         *comp = NULL;
         ctmp.id = s->compress_meth;