Submitted by: Victor Duchovni <Victor.Duchovni@morganstanley.com>
authorDr. Stephen Henson <steve@openssl.org>
Thu, 12 Mar 2009 17:30:29 +0000 (17:30 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 12 Mar 2009 17:30:29 +0000 (17:30 +0000)
Reviewed by: steve@openssl.org

Check return value of sk_SSL_COMP_find() properly.

ssl/ssl_ciph.c

index 4826df8002d2132a8e648055efb68610abec262f..080b00a50140368b47a85ec95527ebb1f48f9385 100644 (file)
@@ -1715,7 +1715,7 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
        comp->method=cm;
        load_builtin_compressions();
        if (ssl_comp_methods
-               && !sk_SSL_COMP_find(ssl_comp_methods,comp))
+               && sk_SSL_COMP_find(ssl_comp_methods,comp) >= 0)
                {
                OPENSSL_free(comp);
                MemCheck_on();