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


test/handshake_helper.c:67:1: start of procedure info_cb()
65.   static int ex_data_idx;
66.   
67. > static void info_cb(const SSL *s, int where, int ret)
68.   {
69.       if (where & SSL_CB_ALERT) {

test/handshake_helper.c:69:9: Taking true branch
67.   static void info_cb(const SSL *s, int where, int ret)
68.   {
69.       if (where & SSL_CB_ALERT) {
              ^
70.           HANDSHAKE_EX_DATA *ex_data =
71.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));

test/handshake_helper.c:70:9: 
68.   {
69.       if (where & SSL_CB_ALERT) {
70. >         HANDSHAKE_EX_DATA *ex_data =
71.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
72.           if (where & SSL_CB_WRITE) {

ssl/ssl_lib.c:3529:1: start of procedure SSL_get_ex_data()
  3527.   }
  3528.   
  3529. > void *SSL_get_ex_data(const SSL *s, int idx)
  3530.   {
  3531.       return (CRYPTO_get_ex_data(&s->ex_data, idx));

ssl/ssl_lib.c:3531:5: 
  3529.   void *SSL_get_ex_data(const SSL *s, int idx)
  3530.   {
  3531. >     return (CRYPTO_get_ex_data(&s->ex_data, idx));
  3532.   }
  3533.   

crypto/ex_data.c:374:1: start of procedure CRYPTO_get_ex_data()
    372.    * particular index in the class used by this variable
    373.    */
    374. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    375.   {
    376.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:376:9: Taking true branch
    374.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    375.   {
    376.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    377.           return NULL;
    378.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:377:9: 
    375.   {
    376.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    377. >         return NULL;
    378.       return sk_void_value(ad->sk, idx);
    379.   }

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

ssl/ssl_lib.c:3532:1: return from a call to SSL_get_ex_data
  3530.   {
  3531.       return (CRYPTO_get_ex_data(&s->ex_data, idx));
  3532. > }
  3533.   
  3534.   int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)

test/handshake_helper.c:72:13: Taking true branch
70.           HANDSHAKE_EX_DATA *ex_data =
71.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
72.           if (where & SSL_CB_WRITE) {
                  ^
73.               ex_data->alert_sent = ret;
74.           } else {

test/handshake_helper.c:73:13: 
71.               (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
72.           if (where & SSL_CB_WRITE) {
73. >             ex_data->alert_sent = ret;
74.           } else {
75.               ex_data->alert_received = ret;
