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


test/handshake_helper.c:140:1: start of procedure client_hello_select_server_ctx()
138.   }
139.   
140. > static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore)
141.   {
142.       const char *servername;

test/handshake_helper.c:145:5: 
143.       const unsigned char *p;
144.       size_t len, remaining;
145. >     HANDSHAKE_EX_DATA *ex_data =
146.           (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
147.   

ssl/ssl_lib.c:3908:1: start of procedure SSL_get_ex_data()
  3906.   }
  3907.   
  3908. > void *SSL_get_ex_data(const SSL *s, int idx)
  3909.   {
  3910.       return CRYPTO_get_ex_data(&s->ex_data, idx);

ssl/ssl_lib.c:3910:5: 
  3908.   void *SSL_get_ex_data(const SSL *s, int idx)
  3909.   {
  3910. >     return CRYPTO_get_ex_data(&s->ex_data, idx);
  3911.   }
  3912.   

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

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

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

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

ssl/ssl_lib.c:3911:1: return from a call to SSL_get_ex_data
  3909.   {
  3910.       return CRYPTO_get_ex_data(&s->ex_data, idx);
  3911. > }
  3912.   
  3913.   int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)

test/handshake_helper.c:152:10: Taking false branch
150.        * was written, so parsing the normal case is a bit complex.
151.        */
152.       if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
                ^
153.                                      &remaining) ||
154.           remaining <= 2)

test/handshake_helper.c:154:9: Taking false branch
152.       if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
153.                                      &remaining) ||
154.           remaining <= 2)
               ^
155.           return 0;
156.       /* Extract the length of the supplied list of names. */

test/handshake_helper.c:157:5: 
155.           return 0;
156.       /* Extract the length of the supplied list of names. */
157. >     len = (*(p++) << 8);
158.       len += *(p++);
159.       if (len + 2 != remaining)

test/handshake_helper.c:158:5: 
156.       /* Extract the length of the supplied list of names. */
157.       len = (*(p++) << 8);
158. >     len += *(p++);
159.       if (len + 2 != remaining)
160.           return 0;

test/handshake_helper.c:159:9: Taking false branch
157.       len = (*(p++) << 8);
158.       len += *(p++);
159.       if (len + 2 != remaining)
               ^
160.           return 0;
161.       remaining = len;

test/handshake_helper.c:161:5: 
159.       if (len + 2 != remaining)
160.           return 0;
161. >     remaining = len;
162.       /*
163.        * The list in practice only has a single element, so we only consider

test/handshake_helper.c:166:9: Taking false branch
164.        * the first one.
165.        */
166.       if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
               ^
167.           return 0;
168.       remaining--;

test/handshake_helper.c:166:27: Taking false branch
164.        * the first one.
165.        */
166.       if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
                                 ^
167.           return 0;
168.       remaining--;

test/handshake_helper.c:168:5: 
166.       if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
167.           return 0;
168. >     remaining--;
169.       /* Now we can finally pull out the byte array with the actual hostname. */
170.       if (remaining <= 2)

test/handshake_helper.c:170:9: Taking false branch
168.       remaining--;
169.       /* Now we can finally pull out the byte array with the actual hostname. */
170.       if (remaining <= 2)
               ^
171.           return 0;
172.       len = (*(p++) << 8);

test/handshake_helper.c:172:5: 
170.       if (remaining <= 2)
171.           return 0;
172. >     len = (*(p++) << 8);
173.       len += *(p++);
174.       if (len + 2 > remaining)

test/handshake_helper.c:173:5: 
171.           return 0;
172.       len = (*(p++) << 8);
173. >     len += *(p++);
174.       if (len + 2 > remaining)
175.           return 0;

test/handshake_helper.c:174:9: Taking false branch
172.       len = (*(p++) << 8);
173.       len += *(p++);
174.       if (len + 2 > remaining)
               ^
175.           return 0;
176.       remaining = len;

test/handshake_helper.c:176:5: 
174.       if (len + 2 > remaining)
175.           return 0;
176. >     remaining = len;
177.       servername = (const char *)p;
178.   

test/handshake_helper.c:177:5: 
175.           return 0;
176.       remaining = len;
177. >     servername = (const char *)p;
178.   
179.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {

test/handshake_helper.c:179:9: Taking true branch
177.       servername = (const char *)p;
178.   
179.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
               ^
180.           SSL_CTX *new_ctx = arg;
181.           SSL_set_SSL_CTX(s, new_ctx);

test/handshake_helper.c:179:37: Taking true branch
177.       servername = (const char *)p;
178.   
179.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
                                           ^
180.           SSL_CTX *new_ctx = arg;
181.           SSL_set_SSL_CTX(s, new_ctx);

test/handshake_helper.c:180:9: 
178.   
179.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
180. >         SSL_CTX *new_ctx = arg;
181.           SSL_set_SSL_CTX(s, new_ctx);
182.           /*

test/handshake_helper.c:181:9: 
179.       if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
180.           SSL_CTX *new_ctx = arg;
181. >         SSL_set_SSL_CTX(s, new_ctx);
182.           /*
183.            * Copy over all the SSL_CTX options - reasonable behavior

ssl/ssl_lib.c:3745:1: start of procedure SSL_set_SSL_CTX()
  3743.   }
  3744.   
  3745. > SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)
  3746.   {
  3747.       CERT *new_cert;

ssl/ssl_lib.c:3748:9: Taking false branch
  3746.   {
  3747.       CERT *new_cert;
  3748.       if (ssl->ctx == ctx)
                  ^
  3749.           return ssl->ctx;
  3750.       if (ctx == NULL)

ssl/ssl_lib.c:3750:9: Taking false branch
  3748.       if (ssl->ctx == ctx)
  3749.           return ssl->ctx;
  3750.       if (ctx == NULL)
                  ^
  3751.           ctx = ssl->session_ctx;
  3752.       new_cert = ssl_cert_dup(ctx->cert);

ssl/ssl_lib.c:3752:5: Skipping ssl_cert_dup(): empty list of specs
  3750.       if (ctx == NULL)
  3751.           ctx = ssl->session_ctx;
  3752.       new_cert = ssl_cert_dup(ctx->cert);
              ^
  3753.       if (new_cert == NULL) {
  3754.           return NULL;

ssl/ssl_lib.c:3753:9: Taking false branch
  3751.           ctx = ssl->session_ctx;
  3752.       new_cert = ssl_cert_dup(ctx->cert);
  3753.       if (new_cert == NULL) {
                  ^
  3754.           return NULL;
  3755.       }

ssl/ssl_lib.c:3757:10: Taking false branch
  3755.       }
  3756.   
  3757.       if (!custom_exts_copy_flags(&new_cert->custext, &ssl->cert->custext)) {
                   ^
  3758.           ssl_cert_free(new_cert);
  3759.           return NULL;

ssl/ssl_lib.c:3762:5: 
  3760.       }
  3761.   
  3762. >     ssl_cert_free(ssl->cert);
  3763.       ssl->cert = new_cert;
  3764.   

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.   

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

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

ssl/ssl_lib.c:3763:5: 
  3761.   
  3762.       ssl_cert_free(ssl->cert);
  3763. >     ssl->cert = new_cert;
  3764.   
  3765.       /*

ssl/ssl_lib.c:3769:10: Condition is true
  3767.        * so setter APIs must prevent invalid lengths from entering the system.
  3768.        */
  3769.       if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))
                   ^
  3770.           return NULL;
  3771.   

ssl/ssl_lib.c:3769:10: Taking false branch
  3767.        * so setter APIs must prevent invalid lengths from entering the system.
  3768.        */
  3769.       if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))
                   ^
  3770.           return NULL;
  3771.   

ssl/ssl_lib.c:3778:10: Taking false branch
  3776.        * leave it unchanged.
  3777.        */
  3778.       if ((ssl->ctx != NULL) &&
                   ^
  3779.           (ssl->sid_ctx_length == ssl->ctx->sid_ctx_length) &&
  3780.           (memcmp(ssl->sid_ctx, ssl->ctx->sid_ctx, ssl->sid_ctx_length) == 0)) {

ssl/ssl_lib.c:3785:5: 
  3783.       }
  3784.   
  3785. >     SSL_CTX_up_ref(ctx);
  3786.       SSL_CTX_free(ssl->ctx);     /* decrement reference count */
  3787.       ssl->ctx = ctx;

ssl/ssl_lib.c:2902:1: start of procedure SSL_CTX_up_ref()
    2900.   }
    2901.   
    2902. > int SSL_CTX_up_ref(SSL_CTX *ctx)
    2903.   {
    2904.       int i;

ssl/ssl_lib.c:2906:9: 
    2904.       int i;
    2905.   
    2906. >     if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)
    2907.           return 0;
    2908.   

include/internal/refcount.h:32:1: start of procedure CRYPTO_UP_REF()
      30.   typedef _Atomic int CRYPTO_REF_COUNT;
      31.   
      32. > static ossl_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 ossl_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.   static ossl_inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)

ssl/ssl_lib.c:2906:9: Taking false branch
    2904.       int i;
    2905.   
    2906.       if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)
                    ^
    2907.           return 0;
    2908.   

ssl/ssl_lib.c:2911:14: Condition is false
    2909.       REF_PRINT_COUNT("SSL_CTX", ctx);
    2910.       REF_ASSERT_ISNT(i < 2);
    2911.       return ((i > 1) ? 1 : 0);
                         ^
    2912.   }
    2913.   

ssl/ssl_lib.c:2911:13: 
    2909.       REF_PRINT_COUNT("SSL_CTX", ctx);
    2910.       REF_ASSERT_ISNT(i < 2);
    2911. >     return ((i > 1) ? 1 : 0);
    2912.   }
    2913.   

ssl/ssl_lib.c:2911:5: 
    2909.       REF_PRINT_COUNT("SSL_CTX", ctx);
    2910.       REF_ASSERT_ISNT(i < 2);
    2911. >     return ((i > 1) ? 1 : 0);
    2912.   }
    2913.   

ssl/ssl_lib.c:2912:1: return from a call to SSL_CTX_up_ref
    2910.       REF_ASSERT_ISNT(i < 2);
    2911.       return ((i > 1) ? 1 : 0);
    2912. > }
    2913.   
    2914.   void SSL_CTX_free(SSL_CTX *a)

ssl/ssl_lib.c:3786:5: Skipping SSL_CTX_free(): empty list of specs
  3784.   
  3785.       SSL_CTX_up_ref(ctx);
  3786.       SSL_CTX_free(ssl->ctx);     /* decrement reference count */
              ^
  3787.       ssl->ctx = ctx;
  3788.   

ssl/ssl_lib.c:3787:5: 
  3785.       SSL_CTX_up_ref(ctx);
  3786.       SSL_CTX_free(ssl->ctx);     /* decrement reference count */
  3787. >     ssl->ctx = ctx;
  3788.   
  3789.       return ssl->ctx;

ssl/ssl_lib.c:3789:5: 
  3787.       ssl->ctx = ctx;
  3788.   
  3789. >     return ssl->ctx;
  3790.   }
  3791.   

ssl/ssl_lib.c:3790:1: return from a call to SSL_set_SSL_CTX
  3788.   
  3789.       return ssl->ctx;
  3790. > }
  3791.   
  3792.   int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx)

test/handshake_helper.c:187:9: 
185.            * contexts differ/conflict
186.            */
187. >         SSL_clear_options(s, 0xFFFFFFFFL);
188.           SSL_set_options(s, SSL_CTX_get_options(new_ctx));
189.   

ssl/ssl_lib.c:4326:1: start of procedure SSL_clear_options()
  4324.   }
  4325.   
  4326. > unsigned long SSL_clear_options(SSL *s, unsigned long op)
  4327.   {
  4328.       return s->options &= ~op;

ssl/ssl_lib.c:4328:5: 
  4326.   unsigned long SSL_clear_options(SSL *s, unsigned long op)
  4327.   {
  4328. >     return s->options &= ~op;
  4329.   }
  4330.   

ssl/ssl_lib.c:4329:1: return from a call to SSL_clear_options
  4327.   {
  4328.       return s->options &= ~op;
  4329. > }
  4330.   
  4331.   STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s)

test/handshake_helper.c:188:9: 
186.            */
187.           SSL_clear_options(s, 0xFFFFFFFFL);
188. >         SSL_set_options(s, SSL_CTX_get_options(new_ctx));
189.   
190.           ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;

ssl/ssl_lib.c:4301:1: start of procedure SSL_CTX_get_options()
  4299.    * control interface.
  4300.    */
  4301. > unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
  4302.   {
  4303.       return ctx->options;

ssl/ssl_lib.c:4303:5: 
  4301.   unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
  4302.   {
  4303. >     return ctx->options;
  4304.   }
  4305.   

ssl/ssl_lib.c:4304:1: return from a call to SSL_CTX_get_options
  4302.   {
  4303.       return ctx->options;
  4304. > }
  4305.   
  4306.   unsigned long SSL_get_options(const SSL *s)

ssl/ssl_lib.c:4316:1: start of procedure SSL_set_options()
  4314.   }
  4315.   
  4316. > unsigned long SSL_set_options(SSL *s, unsigned long op)
  4317.   {
  4318.       return s->options |= op;

ssl/ssl_lib.c:4318:5: 
  4316.   unsigned long SSL_set_options(SSL *s, unsigned long op)
  4317.   {
  4318. >     return s->options |= op;
  4319.   }
  4320.   

ssl/ssl_lib.c:4319:1: return from a call to SSL_set_options
  4317.   {
  4318.       return s->options |= op;
  4319. > }
  4320.   
  4321.   unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op)

test/handshake_helper.c:190:9: 
188.           SSL_set_options(s, SSL_CTX_get_options(new_ctx));
189.   
190. >         ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
191.           return 1;
192.       } 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 ossl_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}']