crypto/ui/ui_util.c:114: error: NULL_DEREFERENCE
  pointer `data` last assigned on line 110 could be null and is dereferenced at line 114, column 23.
Showing all 31 steps of the trace


crypto/ui/ui_util.c:104:1: start of procedure ui_read()
102.       return 1;
103.   }
104. > static int ui_read(UI *ui, UI_STRING *uis)
105.   {
106.       switch (UI_get_string_type(uis)) {

crypto/ui/ui_util.c:106:5: 
104.   static int ui_read(UI *ui, UI_STRING *uis)
105.   {
106. >     switch (UI_get_string_type(uis)) {
107.       case UIT_PROMPT:
108.           {

crypto/ui/ui_lib.c:709:1: start of procedure UI_get_string_type()
  707.   }
  708.   
  709. > enum UI_string_types UI_get_string_type(UI_STRING *uis)
  710.   {
  711.       return uis->type;

crypto/ui/ui_lib.c:711:5: 
  709.   enum UI_string_types UI_get_string_type(UI_STRING *uis)
  710.   {
  711. >     return uis->type;
  712.   }
  713.   

crypto/ui/ui_lib.c:712:1: return from a call to UI_get_string_type
  710.   {
  711.       return uis->type;
  712. > }
  713.   
  714.   int UI_get_input_flags(UI_STRING *uis)

crypto/ui/ui_util.c:107:5: Switch condition is true. Entering switch case
105.   {
106.       switch (UI_get_string_type(uis)) {
107.       case UIT_PROMPT:
           ^
108.           {
109.               char result[PEM_BUFSIZE];

crypto/ui/ui_util.c:110:13: 
108.           {
109.               char result[PEM_BUFSIZE];
110. >             const struct pem_password_cb_data *data =
111.                   UI_method_get_ex_data(UI_get_method(ui),
112.                                         ui_method_data_index());

crypto/ui/ui_lib.c:551:1: start of procedure UI_get_method()
  549.   }
  550.   
  551. > const UI_METHOD *UI_get_method(UI *ui)
  552.   {
  553.       return ui->meth;

crypto/ui/ui_lib.c:553:5: 
  551.   const UI_METHOD *UI_get_method(UI *ui)
  552.   {
  553. >     return ui->meth;
  554.   }
  555.   

crypto/ui/ui_lib.c:554:1: return from a call to UI_get_method
  552.   {
  553.       return ui->meth;
  554. > }
  555.   
  556.   const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth)

crypto/ui/ui_util.c:86:1: start of procedure ui_method_data_index()
  84.   }
  85.   
  86. > static int ui_method_data_index()
  87.   {
  88.       static int idx = -1;

crypto/ui/ui_util.c:88:5: 
  86.   static int ui_method_data_index()
  87.   {
  88. >     static int idx = -1;
  89.   
  90.       if (idx == -1)

crypto/ui/ui_util.c:90:9: Taking true branch
  88.       static int idx = -1;
  89.   
  90.       if (idx == -1)
                ^
  91.           idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI_METHOD,
  92.                                         0, NULL,

crypto/ui/ui_util.c:91:9: Skipping CRYPTO_get_ex_new_index(): empty list of specs
  89.   
  90.       if (idx == -1)
  91.           idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI_METHOD,
                ^
  92.                                         0, NULL,
  93.                                         ui_new_method_data,

crypto/ui/ui_util.c:97:5: 
  95.                                         ui_free_method_data);
  96.   
  97. >     return idx;
  98.   }
  99.   

crypto/ui/ui_util.c:98:1: return from a call to ui_method_data_index
  96.   
  97.       return idx;
  98. > }
  99.   
  100.   static int ui_open(UI *ui)

crypto/ui/ui_lib.c:704:1: start of procedure UI_method_get_ex_data()
  702.   }
  703.   
  704. > const void *UI_method_get_ex_data(const UI_METHOD *method, int idx)
  705.   {
  706.       return CRYPTO_get_ex_data(&method->ex_data, idx);

crypto/ui/ui_lib.c:706:5: 
  704.   const void *UI_method_get_ex_data(const UI_METHOD *method, int idx)
  705.   {
  706. >     return CRYPTO_get_ex_data(&method->ex_data, idx);
  707.   }
  708.   

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

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

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

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

crypto/ui/ui_lib.c:707:1: return from a call to UI_method_get_ex_data
  705.   {
  706.       return CRYPTO_get_ex_data(&method->ex_data, idx);
  707. > }
  708.   
  709.   enum UI_string_types UI_get_string_type(UI_STRING *uis)

crypto/ui/ui_util.c:113:13: 
111.                   UI_method_get_ex_data(UI_get_method(ui),
112.                                         ui_method_data_index());
113. >             int maxsize = UI_get_result_maxsize(uis);
114.               int len = data->cb(result,
115.                                  maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize,

crypto/ui/ui_lib.c:784:1: start of procedure UI_get_result_maxsize()
  782.   }
  783.   
  784. > int UI_get_result_maxsize(UI_STRING *uis)
  785.   {
  786.       switch (uis->type) {

crypto/ui/ui_lib.c:786:5: 
  784.   int UI_get_result_maxsize(UI_STRING *uis)
  785.   {
  786. >     switch (uis->type) {
  787.       case UIT_PROMPT:
  788.       case UIT_VERIFY:

crypto/ui/ui_lib.c:787:5: Switch condition is true. Entering switch case
  785.   {
  786.       switch (uis->type) {
  787.       case UIT_PROMPT:
             ^
  788.       case UIT_VERIFY:
  789.           return uis->_.string_data.result_maxsize;

crypto/ui/ui_lib.c:789:9: 
  787.       case UIT_PROMPT:
  788.       case UIT_VERIFY:
  789. >         return uis->_.string_data.result_maxsize;
  790.       case UIT_NONE:
  791.       case UIT_INFO:

crypto/ui/ui_lib.c:797:1: return from a call to UI_get_result_maxsize
  795.       }
  796.       return -1;
  797. > }
  798.   
  799.   int UI_set_result(UI *ui, UI_STRING *uis, const char *result)

crypto/ui/ui_util.c:115:32: Condition is false
113.               int maxsize = UI_get_result_maxsize(uis);
114.               int len = data->cb(result,
115.                                  maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize,
                                      ^
116.                                  data->rwflag, UI_get0_user_data(ui));
117.   

crypto/ui/ui_util.c:114:13: 
112.                                         ui_method_data_index());
113.               int maxsize = UI_get_result_maxsize(uis);
114. >             int len = data->cb(result,
115.                                  maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize,
116.                                  data->rwflag, UI_get0_user_data(ui));
