test/handshake_helper.c:84: error: NULL_DEREFERENCE
  pointer `ex_data` last assigned on line 81 could be null and is dereferenced at line 84, column 13.
Showing all 12 steps of the trace


test/handshake_helper.c:78:1: start of procedure info_cb()
76.   static int ex_data_idx;
77.   
78. > static void info_cb(const SSL *s, int where, int ret)
79.   {
80.       if (where & SSL_CB_ALERT) {

test/handshake_helper.c:80:9: Taking true branch
78.   static void info_cb(const SSL *s, int where, int ret)
79.   {
80.       if (where & SSL_CB_ALERT) {
              ^
81.           HANDSHAKE_EX_DATA *ex_data =
82.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));

test/handshake_helper.c:81:9: 
79.   {
80.       if (where & SSL_CB_ALERT) {
81. >         HANDSHAKE_EX_DATA *ex_data =
82.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
83.           if (where & SSL_CB_WRITE) {

ssl/ssl_lib.c:3730:1: start of procedure SSL_get_ex_data()
  3728.   }
  3729.   
  3730. > void *SSL_get_ex_data(const SSL *s, int idx)
  3731.   {
  3732.       return (CRYPTO_get_ex_data(&s->ex_data, idx));

ssl/ssl_lib.c:3732:5: 
  3730.   void *SSL_get_ex_data(const SSL *s, int idx)
  3731.   {
  3732. >     return (CRYPTO_get_ex_data(&s->ex_data, idx));
  3733.   }
  3734.   

crypto/ex_data.c:379:1: start of procedure CRYPTO_get_ex_data()
    377.    * particular index in the class used by this variable
    378.    */
    379. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    380.   {
    381.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:381:9: Taking true branch
    379.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    380.   {
    381.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    382.           return NULL;
    383.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:382:9: 
    380.   {
    381.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    382. >         return NULL;
    383.       return sk_void_value(ad->sk, idx);
    384.   }

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

ssl/ssl_lib.c:3733:1: return from a call to SSL_get_ex_data
  3731.   {
  3732.       return (CRYPTO_get_ex_data(&s->ex_data, idx));
  3733. > }
  3734.   
  3735.   int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)

test/handshake_helper.c:83:13: Taking true branch
81.           HANDSHAKE_EX_DATA *ex_data =
82.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
83.           if (where & SSL_CB_WRITE) {
                  ^
84.               ex_data->alert_sent = ret;
85.               if (strcmp(SSL_alert_type_string(ret), "F") == 0

test/handshake_helper.c:84:13: 
82.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
83.           if (where & SSL_CB_WRITE) {
84. >             ex_data->alert_sent = ret;
85.               if (strcmp(SSL_alert_type_string(ret), "F") == 0
86.                   || strcmp(SSL_alert_desc_string(ret), "CN") == 0)
