test/handshake_helper.c:333: error: NULL_DEREFERENCE
  pointer `ex_data` last assigned on line 331 could be null and is dereferenced at line 333, column 5.
Showing all 10 steps of the trace


test/handshake_helper.c:326:1: start of procedure do_not_call_session_ticket_cb()
324.   }
325.   
326. > static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name,
327.                                            unsigned char *iv,
328.                                            EVP_CIPHER_CTX *ctx,

test/handshake_helper.c:331:5: 
329.                                            HMAC_CTX *hctx, int enc)
330.   {
331. >     HANDSHAKE_EX_DATA *ex_data =
332.           (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
333.       ex_data->session_ticket_do_not_call = 1;

ssl/ssl_lib.c:4215:1: start of procedure SSL_get_ex_data()
  4213.   }
  4214.   
  4215. > void *SSL_get_ex_data(const SSL *s, int idx)
  4216.   {
  4217.       return CRYPTO_get_ex_data(&s->ex_data, idx);

ssl/ssl_lib.c:4217:5: 
  4215.   void *SSL_get_ex_data(const SSL *s, int idx)
  4216.   {
  4217. >     return CRYPTO_get_ex_data(&s->ex_data, idx);
  4218.   }
  4219.   

crypto/ex_data.c:458:1: start of procedure CRYPTO_get_ex_data()
    456.    * particular index in the class used by this variable
    457.    */
    458. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:460:9: Taking true branch
    458.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    461.           return NULL;
    462.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:461:9: 
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    461. >         return NULL;
    462.       return sk_void_value(ad->sk, idx);
    463.   }

crypto/ex_data.c:463:1: return from a call to CRYPTO_get_ex_data
    461.           return NULL;
    462.       return sk_void_value(ad->sk, idx);
    463. > }
    464.   
    465.   OPENSSL_CTX *crypto_ex_data_get_openssl_ctx(const CRYPTO_EX_DATA *ad)

ssl/ssl_lib.c:4218:1: return from a call to SSL_get_ex_data
  4216.   {
  4217.       return CRYPTO_get_ex_data(&s->ex_data, idx);
  4218. > }
  4219.   
  4220.   int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)

test/handshake_helper.c:333:5: 
331.       HANDSHAKE_EX_DATA *ex_data =
332.           (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
333. >     ex_data->session_ticket_do_not_call = 1;
334.       return 0;
335.   }

static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name,
                                         unsigned char *iv,
                                         EVP_CIPHER_CTX *ctx,
                                         HMAC_CTX *hctx, int enc)
{
    HANDSHAKE_EX_DATA *ex_data =
        (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
    ex_data->session_ticket_do_not_call = 1;
    return 0;
}
['static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name,\n                                         unsigned char *iv,\n                                         EVP_CIPHER_CTX *ctx,\n                                         HMAC_CTX *hctx, int enc)\n{\n    HANDSHAKE_EX_DATA *ex_data =\n        (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));\n    ex_data->session_ticket_do_not_call = 1;\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}']