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


test/handshake_helper.c:322:1: start of procedure do_not_call_session_ticket_cb()
320.   }
321.   
322. > static int do_not_call_session_ticket_cb(SSL *s, unsigned char *key_name,
323.                                            unsigned char *iv,
324.                                            EVP_CIPHER_CTX *ctx,

test/handshake_helper.c:327:5: 
325.                                            HMAC_CTX *hctx, int enc)
326.   {
327. >     HANDSHAKE_EX_DATA *ex_data =
328.           (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
329.       ex_data->session_ticket_do_not_call = 1;

ssl/ssl_lib.c:4045:1: start of procedure SSL_get_ex_data()
  4043.   }
  4044.   
  4045. > void *SSL_get_ex_data(const SSL *s, int idx)
  4046.   {
  4047.       return CRYPTO_get_ex_data(&s->ex_data, idx);

ssl/ssl_lib.c:4047:5: 
  4045.   void *SSL_get_ex_data(const SSL *s, int idx)
  4046.   {
  4047. >     return CRYPTO_get_ex_data(&s->ex_data, idx);
  4048.   }
  4049.   

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:4048:1: return from a call to SSL_get_ex_data
  4046.   {
  4047.       return CRYPTO_get_ex_data(&s->ex_data, idx);
  4048. > }
  4049.   
  4050.   int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)

test/handshake_helper.c:329:5: 
327.       HANDSHAKE_EX_DATA *ex_data =
328.           (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
329. >     ex_data->session_ticket_do_not_call = 1;
330.       return 0;
331.   }

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}']