test/handshake_helper.c:196: error: NULL_DEREFERENCE
  pointer `ex_data` last assigned on line 151 could be null and is dereferenced at line 196, column 9.
Showing all 71 steps of the trace


test/handshake_helper.c:146:1: start of procedure client_hello_select_server_ctx()
144.   }
145.   
146. > static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore)
147.   {
148.       const char *servername;

test/handshake_helper.c:151:5: 
149.       const unsigned char *p;
150.       size_t len, remaining;
151. >     HANDSHAKE_EX_DATA *ex_data =
152.           (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
153.   

ssl/ssl_lib.c:4114:1: start of procedure SSL_get_ex_data()
  4112.   }
  4113.   
  4114. > void *SSL_get_ex_data(const SSL *s, int idx)
  4115.   {
  4116.       return CRYPTO_get_ex_data(&s->ex_data, idx);

ssl/ssl_lib.c:4116:5: 
  4114.   void *SSL_get_ex_data(const SSL *s, int idx)
  4115.   {
  4116. >     return CRYPTO_get_ex_data(&s->ex_data, idx);
  4117.   }
  4118.   

crypto/ex_data.c:394:1: start of procedure CRYPTO_get_ex_data()
    392.    * particular index in the class used by this variable
    393.    */
    394. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    395.   {
    396.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:396:9: Taking true branch
    394.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    395.   {
    396.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    397.           return NULL;
    398.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:397:9: 
    395.   {
    396.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    397. >         return NULL;
    398.       return sk_void_value(ad->sk, idx);
    399.   }

crypto/ex_data.c:399:1: return from a call to CRYPTO_get_ex_data
    397.           return NULL;
    398.       return sk_void_value(ad->sk, idx);
    399. > }

ssl/ssl_lib.c:4117:1: return from a call to SSL_get_ex_data
  4115.   {
  4116.       return CRYPTO_get_ex_data(&s->ex_data, idx);
  4117. > }
  4118.   
  4119.   int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)

test/handshake_helper.c:158:10: Taking false branch
156.        * was written, so parsing the normal case is a bit complex.
157.        */
158.       if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
                ^
159.                                      &remaining) ||
160.           remaining <= 2)

test/handshake_helper.c:160:9: Taking false branch
158.       if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
159.                                      &remaining) ||
160.           remaining <= 2)
               ^
161.           return 0;
162.       /* Extract the length of the supplied list of names. */

test/handshake_helper.c:163:5: 
161.           return 0;
162.       /* Extract the length of the supplied list of names. */
163. >     len = (*(p++) << 8);
164.       len += *(p++);
165.       if (len + 2 != remaining)

test/handshake_helper.c:164:5: 
162.       /* Extract the length of the supplied list of names. */
163.       len = (*(p++) << 8);
164. >     len += *(p++);
165.       if (len + 2 != remaining)
166.           return 0;

test/handshake_helper.c:165:9: Taking false branch
163.       len = (*(p++) << 8);
164.       len += *(p++);
165.       if (len + 2 != remaining)
               ^
166.           return 0;
167.       remaining = len;

test/handshake_helper.c:167:5: 
165.       if (len + 2 != remaining)
166.           return 0;
167. >     remaining = len;
168.       /*
169.        * The list in practice only has a single element, so we only consider

test/handshake_helper.c:172:9: Taking false branch
170.        * the first one.
171.        */
172.       if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
               ^
173.           return 0;
174.       remaining--;

test/handshake_helper.c:172:27: Taking false branch
170.        * the first one.
171.        */
172.       if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
                                 ^
173.           return 0;
174.       remaining--;

test/handshake_helper.c:174:5: 
172.       if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
173.           return 0;
174. >     remaining--;
175.       /* Now we can finally pull out the byte array with the actual hostname. */
176.       if (remaining <= 2)

test/handshake_helper.c:176:9: Taking false branch
174.       remaining--;
175.       /* Now we can finally pull out the byte array with the actual hostname. */
176.       if (remaining <= 2)
               ^
177.           return 0;
178.       len = (*(p++) << 8);

test/handshake_helper.c:178:5: 
176.       if (remaining <= 2)
177.           return 0;
178. >     len = (*(p++) << 8);
179.       len += *(p++);
180.       if (len + 2 > remaining)

test/handshake_helper.c:179:5: 
177.           return 0;
178.       len = (*(p++) << 8);
179. >     len += *(p++);
180.       if (len + 2 > remaining)
181.           return 0;

test/handshake_helper.c:180:9: Taking false branch
178.       len = (*(p++) << 8);
179.       len += *(p++);
180.       if (len + 2 > remaining)
               ^
181.           return 0;
182.       remaining = len;

test/handshake_helper.c:182:5: 
180.       if (len + 2 > remaining)
181.           return 0;
182. >     remaining = len;
183.       servername = (const char *)p;
184.   

test/handshake_helper.c:183:5: 
181.           return 0;
182.       remaining = len;
183. >     servername = (const char *)p;
184.   
185.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {

test/handshake_helper.c:185:9: Taking true branch
183.       servername = (const char *)p;
184.   
185.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
               ^
186.           SSL_CTX *new_ctx = arg;
187.           SSL_set_SSL_CTX(s, new_ctx);

test/handshake_helper.c:185:37: Taking true branch
183.       servername = (const char *)p;
184.   
185.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
                                           ^
186.           SSL_CTX *new_ctx = arg;
187.           SSL_set_SSL_CTX(s, new_ctx);

test/handshake_helper.c:186:9: 
184.   
185.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
186. >         SSL_CTX *new_ctx = arg;
187.           SSL_set_SSL_CTX(s, new_ctx);
188.           /*

test/handshake_helper.c:187:9: 
185.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
186.           SSL_CTX *new_ctx = arg;
187. >         SSL_set_SSL_CTX(s, new_ctx);
188.           /*
189.            * Copy over all the SSL_CTX options - reasonable behavior

ssl/ssl_lib.c:3951:1: start of procedure SSL_set_SSL_CTX()
  3949.   }
  3950.   
  3951. > SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)
  3952.   {
  3953.       CERT *new_cert;

ssl/ssl_lib.c:3954:9: Taking false branch
  3952.   {
  3953.       CERT *new_cert;
  3954.       if (ssl->ctx == ctx)
                  ^
  3955.           return ssl->ctx;
  3956.       if (ctx == NULL)

ssl/ssl_lib.c:3956:9: Taking false branch
  3954.       if (ssl->ctx == ctx)
  3955.           return ssl->ctx;
  3956.       if (ctx == NULL)
                  ^
  3957.           ctx = ssl->session_ctx;
  3958.       new_cert = ssl_cert_dup(ctx->cert);

ssl/ssl_lib.c:3958:5: Skipping ssl_cert_dup(): empty list of specs
  3956.       if (ctx == NULL)
  3957.           ctx = ssl->session_ctx;
  3958.       new_cert = ssl_cert_dup(ctx->cert);
              ^
  3959.       if (new_cert == NULL) {
  3960.           return NULL;

ssl/ssl_lib.c:3959:9: Taking false branch
  3957.           ctx = ssl->session_ctx;
  3958.       new_cert = ssl_cert_dup(ctx->cert);
  3959.       if (new_cert == NULL) {
                  ^
  3960.           return NULL;
  3961.       }

ssl/ssl_lib.c:3963:10: Taking false branch
  3961.       }
  3962.   
  3963.       if (!custom_exts_copy_flags(&new_cert->custext, &ssl->cert->custext)) {
                   ^
  3964.           ssl_cert_free(new_cert);
  3965.           return NULL;

ssl/ssl_lib.c:3968:5: 
  3966.       }
  3967.   
  3968. >     ssl_cert_free(ssl->cert);
  3969.       ssl->cert = new_cert;
  3970.   

ssl/ssl_cert.c:224:1: start of procedure ssl_cert_free()
    222.   }
    223.   
    224. > void ssl_cert_free(CERT *c)
    225.   {
    226.       int i;

ssl/ssl_cert.c:228:9: Taking true branch
    226.       int i;
    227.   
    228.       if (c == NULL)
                   ^
    229.           return;
    230.       CRYPTO_DOWN_REF(&c->references, &i, c->lock);

ssl/ssl_cert.c:229:9: 
    227.   
    228.       if (c == NULL)
    229. >         return;
    230.       CRYPTO_DOWN_REF(&c->references, &i, c->lock);
    231.       REF_PRINT_COUNT("CERT", c);

ssl/ssl_cert.c:253:1: return from a call to ssl_cert_free
    251.       CRYPTO_THREAD_lock_free(c->lock);
    252.       OPENSSL_free(c);
    253. > }
    254.   
    255.   int ssl_cert_set0_chain(SSL *s, SSL_CTX *ctx, STACK_OF(X509) *chain)

ssl/ssl_lib.c:3969:5: 
  3967.   
  3968.       ssl_cert_free(ssl->cert);
  3969. >     ssl->cert = new_cert;
  3970.   
  3971.       /*

ssl/ssl_lib.c:3975:10: Condition is true
  3973.        * so setter APIs must prevent invalid lengths from entering the system.
  3974.        */
  3975.       if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))
                   ^
  3976.           return NULL;
  3977.   

ssl/ssl_lib.c:3975:10: Taking false branch
  3973.        * so setter APIs must prevent invalid lengths from entering the system.
  3974.        */
  3975.       if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))
                   ^
  3976.           return NULL;
  3977.   

ssl/ssl_lib.c:3984:10: Taking false branch
  3982.        * leave it unchanged.
  3983.        */
  3984.       if ((ssl->ctx != NULL) &&
                   ^
  3985.           (ssl->sid_ctx_length == ssl->ctx->sid_ctx_length) &&
  3986.           (memcmp(ssl->sid_ctx, ssl->ctx->sid_ctx, ssl->sid_ctx_length) == 0)) {

ssl/ssl_lib.c:3991:5: 
  3989.       }
  3990.   
  3991. >     SSL_CTX_up_ref(ctx);
  3992.       SSL_CTX_free(ssl->ctx);     /* decrement reference count */
  3993.       ssl->ctx = ctx;

ssl/ssl_lib.c:3063:1: start of procedure SSL_CTX_up_ref()
    3061.   }
    3062.   
    3063. > int SSL_CTX_up_ref(SSL_CTX *ctx)
    3064.   {
    3065.       int i;

ssl/ssl_lib.c:3067:9: 
    3065.       int i;
    3066.   
    3067. >     if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)
    3068.           return 0;
    3069.   

include/internal/refcount.h:32:1: start of procedure CRYPTO_UP_REF()
      30.   typedef _Atomic int CRYPTO_REF_COUNT;
      31.   
      32. > static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
      33.   {
      34.       *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;

include/internal/refcount.h:34:5: 
      32.   static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
      33.   {
      34. >     *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
      35.       return 1;
      36.   }

include/internal/refcount.h:35:5: 
      33.   {
      34.       *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
      35. >     return 1;
      36.   }
      37.   

include/internal/refcount.h:36:1: return from a call to CRYPTO_UP_REF
      34.       *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
      35.       return 1;
      36. > }
      37.   
      38.   /*

ssl/ssl_lib.c:3067:9: Taking false branch
    3065.       int i;
    3066.   
    3067.       if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)
                    ^
    3068.           return 0;
    3069.   

ssl/ssl_lib.c:3072:14: Condition is false
    3070.       REF_PRINT_COUNT("SSL_CTX", ctx);
    3071.       REF_ASSERT_ISNT(i < 2);
    3072.       return ((i > 1) ? 1 : 0);
                         ^
    3073.   }
    3074.   

ssl/ssl_lib.c:3072:13: 
    3070.       REF_PRINT_COUNT("SSL_CTX", ctx);
    3071.       REF_ASSERT_ISNT(i < 2);
    3072. >     return ((i > 1) ? 1 : 0);
    3073.   }
    3074.   

ssl/ssl_lib.c:3072:5: 
    3070.       REF_PRINT_COUNT("SSL_CTX", ctx);
    3071.       REF_ASSERT_ISNT(i < 2);
    3072. >     return ((i > 1) ? 1 : 0);
    3073.   }
    3074.   

ssl/ssl_lib.c:3073:1: return from a call to SSL_CTX_up_ref
    3071.       REF_ASSERT_ISNT(i < 2);
    3072.       return ((i > 1) ? 1 : 0);
    3073. > }
    3074.   
    3075.   void SSL_CTX_free(SSL_CTX *a)

ssl/ssl_lib.c:3992:5: Skipping SSL_CTX_free(): empty list of specs
  3990.   
  3991.       SSL_CTX_up_ref(ctx);
  3992.       SSL_CTX_free(ssl->ctx);     /* decrement reference count */
              ^
  3993.       ssl->ctx = ctx;
  3994.   

ssl/ssl_lib.c:3993:5: 
  3991.       SSL_CTX_up_ref(ctx);
  3992.       SSL_CTX_free(ssl->ctx);     /* decrement reference count */
  3993. >     ssl->ctx = ctx;
  3994.   
  3995.       return ssl->ctx;

ssl/ssl_lib.c:3995:5: 
  3993.       ssl->ctx = ctx;
  3994.   
  3995. >     return ssl->ctx;
  3996.   }
  3997.   

ssl/ssl_lib.c:3996:1: return from a call to SSL_set_SSL_CTX
  3994.   
  3995.       return ssl->ctx;
  3996. > }
  3997.   
  3998.   int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx)

test/handshake_helper.c:193:9: 
191.            * contexts differ/conflict
192.            */
193. >         SSL_clear_options(s, 0xFFFFFFFFL);
194.           SSL_set_options(s, SSL_CTX_get_options(new_ctx));
195.   

ssl/ssl_lib.c:4562:1: start of procedure SSL_clear_options()
  4560.   }
  4561.   
  4562. > unsigned long SSL_clear_options(SSL *s, unsigned long op)
  4563.   {
  4564.       return s->options &= ~op;

ssl/ssl_lib.c:4564:5: 
  4562.   unsigned long SSL_clear_options(SSL *s, unsigned long op)
  4563.   {
  4564. >     return s->options &= ~op;
  4565.   }
  4566.   

ssl/ssl_lib.c:4565:1: return from a call to SSL_clear_options
  4563.   {
  4564.       return s->options &= ~op;
  4565. > }
  4566.   
  4567.   STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s)

test/handshake_helper.c:194:9: 
192.            */
193.           SSL_clear_options(s, 0xFFFFFFFFL);
194. >         SSL_set_options(s, SSL_CTX_get_options(new_ctx));
195.   
196.           ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;

ssl/ssl_lib.c:4537:1: start of procedure SSL_CTX_get_options()
  4535.    * control interface.
  4536.    */
  4537. > unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
  4538.   {
  4539.       return ctx->options;

ssl/ssl_lib.c:4539:5: 
  4537.   unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
  4538.   {
  4539. >     return ctx->options;
  4540.   }
  4541.   

ssl/ssl_lib.c:4540:1: return from a call to SSL_CTX_get_options
  4538.   {
  4539.       return ctx->options;
  4540. > }
  4541.   
  4542.   unsigned long SSL_get_options(const SSL *s)

ssl/ssl_lib.c:4552:1: start of procedure SSL_set_options()
  4550.   }
  4551.   
  4552. > unsigned long SSL_set_options(SSL *s, unsigned long op)
  4553.   {
  4554.       return s->options |= op;

ssl/ssl_lib.c:4554:5: 
  4552.   unsigned long SSL_set_options(SSL *s, unsigned long op)
  4553.   {
  4554. >     return s->options |= op;
  4555.   }
  4556.   

ssl/ssl_lib.c:4555:1: return from a call to SSL_set_options
  4553.   {
  4554.       return s->options |= op;
  4555. > }
  4556.   
  4557.   unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op)

test/handshake_helper.c:196:9: 
194.           SSL_set_options(s, SSL_CTX_get_options(new_ctx));
195.   
196. >         ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
197.           return 1;
198.       } else if (len == strlen("server1") &&

static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore)
{
    const char *servername;
    const unsigned char *p;
    size_t len, remaining;
    HANDSHAKE_EX_DATA *ex_data =
        (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
    if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
                                   &remaining) ||
        remaining <= 2)
        return 0;
    len = (*(p++) << 8);
    len += *(p++);
    if (len + 2 != remaining)
        return 0;
    remaining = len;
    if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
        return 0;
    remaining--;
    if (remaining <= 2)
        return 0;
    len = (*(p++) << 8);
    len += *(p++);
    if (len + 2 > remaining)
        return 0;
    remaining = len;
    servername = (const char *)p;
    if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
        SSL_CTX *new_ctx = arg;
        SSL_set_SSL_CTX(s, new_ctx);
        SSL_clear_options(s, 0xFFFFFFFFL);
        SSL_set_options(s, SSL_CTX_get_options(new_ctx));
        ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
        return 1;
    } else if (len == strlen("server1") &&
               strncmp(servername, "server1", len) == 0) {
        ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
        return 1;
    } else if (ignore) {
        ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
        return 1;
    }
    return 0;
}
['static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore)\n{\n    const char *servername;\n    const unsigned char *p;\n    size_t len, remaining;\n    HANDSHAKE_EX_DATA *ex_data =\n        (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));\n    if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,\n                                   &remaining) ||\n        remaining <= 2)\n        return 0;\n    len = (*(p++) << 8);\n    len += *(p++);\n    if (len + 2 != remaining)\n        return 0;\n    remaining = len;\n    if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)\n        return 0;\n    remaining--;\n    if (remaining <= 2)\n        return 0;\n    len = (*(p++) << 8);\n    len += *(p++);\n    if (len + 2 > remaining)\n        return 0;\n    remaining = len;\n    servername = (const char *)p;\n    if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {\n        SSL_CTX *new_ctx = arg;\n        SSL_set_SSL_CTX(s, new_ctx);\n        SSL_clear_options(s, 0xFFFFFFFFL);\n        SSL_set_options(s, SSL_CTX_get_options(new_ctx));\n        ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;\n        return 1;\n    } else if (len == strlen("server1") &&\n               strncmp(servername, "server1", len) == 0) {\n        ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;\n        return 1;\n    } else if (ignore) {\n        ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;\n        return 1;\n    }\n    return 0;\n}', 'void *SSL_get_ex_data(const SSL *s, int idx)\n{\n    return CRYPTO_get_ex_data(&s->ex_data, idx);\n}', 'void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)\n{\n    if (ad->sk == NULL || idx >= sk_void_num(ad->sk))\n        return NULL;\n    return sk_void_value(ad->sk, idx);\n}', 'SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)\n{\n    CERT *new_cert;\n    if (ssl->ctx == ctx)\n        return ssl->ctx;\n    if (ctx == NULL)\n        ctx = ssl->session_ctx;\n    new_cert = ssl_cert_dup(ctx->cert);\n    if (new_cert == NULL) {\n        return NULL;\n    }\n    if (!custom_exts_copy_flags(&new_cert->custext, &ssl->cert->custext)) {\n        ssl_cert_free(new_cert);\n        return NULL;\n    }\n    ssl_cert_free(ssl->cert);\n    ssl->cert = new_cert;\n    if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))\n        return NULL;\n    if ((ssl->ctx != NULL) &&\n        (ssl->sid_ctx_length == ssl->ctx->sid_ctx_length) &&\n        (memcmp(ssl->sid_ctx, ssl->ctx->sid_ctx, ssl->sid_ctx_length) == 0)) {\n        ssl->sid_ctx_length = ctx->sid_ctx_length;\n        memcpy(&ssl->sid_ctx, &ctx->sid_ctx, sizeof(ssl->sid_ctx));\n    }\n    SSL_CTX_up_ref(ctx);\n    SSL_CTX_free(ssl->ctx);\n    ssl->ctx = ctx;\n    return ssl->ctx;\n}', 'void ssl_cert_free(CERT *c)\n{\n    int i;\n    if (c == NULL)\n        return;\n    CRYPTO_DOWN_REF(&c->references, &i, c->lock);\n    REF_PRINT_COUNT("CERT", c);\n    if (i > 0)\n        return;\n    REF_ASSERT_ISNT(i < 0);\n#ifndef OPENSSL_NO_DH\n    EVP_PKEY_free(c->dh_tmp);\n#endif\n    ssl_cert_clear_certs(c);\n    OPENSSL_free(c->conf_sigalgs);\n    OPENSSL_free(c->client_sigalgs);\n    OPENSSL_free(c->shared_sigalgs);\n    OPENSSL_free(c->ctype);\n    X509_STORE_free(c->verify_store);\n    X509_STORE_free(c->chain_store);\n    custom_exts_free(&c->custext);\n#ifndef OPENSSL_NO_PSK\n    OPENSSL_free(c->psk_identity_hint);\n#endif\n    CRYPTO_THREAD_lock_free(c->lock);\n    OPENSSL_free(c);\n}', 'int SSL_CTX_up_ref(SSL_CTX *ctx)\n{\n    int i;\n    if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)\n        return 0;\n    REF_PRINT_COUNT("SSL_CTX", ctx);\n    REF_ASSERT_ISNT(i < 2);\n    return ((i > 1) ? 1 : 0);\n}', 'static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)\n{\n    *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;\n    return 1;\n}', 'unsigned long SSL_clear_options(SSL *s, unsigned long op)\n{\n    return s->options &= ~op;\n}', 'unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)\n{\n    return ctx->options;\n}', 'unsigned long SSL_set_options(SSL *s, unsigned long op)\n{\n    return s->options |= op;\n}']