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


test/handshake_helper.c:88:1: start of procedure info_cb()
86.   static int ex_data_idx;
87.   
88. > static void info_cb(const SSL *s, int where, int ret)
89.   {
90.       if (where & SSL_CB_ALERT) {

test/handshake_helper.c:90:9: Taking true branch
88.   static void info_cb(const SSL *s, int where, int ret)
89.   {
90.       if (where & SSL_CB_ALERT) {
              ^
91.           HANDSHAKE_EX_DATA *ex_data =
92.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));

test/handshake_helper.c:91:9: 
89.   {
90.       if (where & SSL_CB_ALERT) {
91. >         HANDSHAKE_EX_DATA *ex_data =
92.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
93.           if (where & SSL_CB_WRITE) {

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:93:13: Taking true branch
91.           HANDSHAKE_EX_DATA *ex_data =
92.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
93.           if (where & SSL_CB_WRITE) {
                  ^
94.               ex_data->alert_sent = ret;
95.               if (strcmp(SSL_alert_type_string(ret), "F") == 0

test/handshake_helper.c:94:13: 
92.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
93.           if (where & SSL_CB_WRITE) {
94. >             ex_data->alert_sent = ret;
95.               if (strcmp(SSL_alert_type_string(ret), "F") == 0
96.                   || strcmp(SSL_alert_desc_string(ret), "CN") == 0)
