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


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

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

crypto/ui/ui_lib.c:768:1: start of procedure UI_get_string_type()
  766.   }
  767.   
  768. > enum UI_string_types UI_get_string_type(UI_STRING *uis)
  769.   {
  770.       return uis->type;

crypto/ui/ui_lib.c:770:5: 
  768.   enum UI_string_types UI_get_string_type(UI_STRING *uis)
  769.   {
  770. >     return uis->type;
  771.   }
  772.   

crypto/ui/ui_lib.c:771:1: return from a call to UI_get_string_type
  769.   {
  770.       return uis->type;
  771. > }
  772.   
  773.   int UI_get_input_flags(UI_STRING *uis)

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

crypto/ui/ui_util.c:108:13: 
106.           {
107.               char result[PEM_BUFSIZE + 1];
108. >             const struct pem_password_cb_data *data =
109.                   UI_method_get_ex_data(UI_get_method(ui), ui_method_data_index);
110.               int maxsize = UI_get_result_maxsize(uis);

crypto/ui/ui_lib.c:584:1: start of procedure UI_get_method()
  582.   }
  583.   
  584. > const UI_METHOD *UI_get_method(UI *ui)
  585.   {
  586.       return ui->meth;

crypto/ui/ui_lib.c:586:5: 
  584.   const UI_METHOD *UI_get_method(UI *ui)
  585.   {
  586. >     return ui->meth;
  587.   }
  588.   

crypto/ui/ui_lib.c:587:1: return from a call to UI_get_method
  585.   {
  586.       return ui->meth;
  587. > }
  588.   
  589.   const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth)

crypto/ui/ui_lib.c:763:1: start of procedure UI_method_get_ex_data()
  761.   }
  762.   
  763. > const void *UI_method_get_ex_data(const UI_METHOD *method, int idx)
  764.   {
  765.       return CRYPTO_get_ex_data(&method->ex_data, idx);

crypto/ui/ui_lib.c:765:5: 
  763.   const void *UI_method_get_ex_data(const UI_METHOD *method, int idx)
  764.   {
  765. >     return CRYPTO_get_ex_data(&method->ex_data, idx);
  766.   }
  767.   

crypto/ex_data.c:458:1: start of procedure CRYPTO_get_ex_data()
    456.    * particular index in the class used by this variable
    457.    */
    458. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:460:9: Taking true branch
    458.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    461.           return NULL;
    462.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:461:9: 
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    461. >         return NULL;
    462.       return sk_void_value(ad->sk, idx);
    463.   }

crypto/ex_data.c:463:1: return from a call to CRYPTO_get_ex_data
    461.           return NULL;
    462.       return sk_void_value(ad->sk, idx);
    463. > }
    464.   
    465.   OPENSSL_CTX *crypto_ex_data_get_openssl_ctx(const CRYPTO_EX_DATA *ad)

crypto/ui/ui_lib.c:766:1: return from a call to UI_method_get_ex_data
  764.   {
  765.       return CRYPTO_get_ex_data(&method->ex_data, idx);
  766. > }
  767.   
  768.   enum UI_string_types UI_get_string_type(UI_STRING *uis)

crypto/ui/ui_util.c:110:13: 
108.               const struct pem_password_cb_data *data =
109.                   UI_method_get_ex_data(UI_get_method(ui), ui_method_data_index);
110. >             int maxsize = UI_get_result_maxsize(uis);
111.               int len = data->cb(result,
112.                                  maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize,

crypto/ui/ui_lib.c:858:1: start of procedure UI_get_result_maxsize()
  856.   }
  857.   
  858. > int UI_get_result_maxsize(UI_STRING *uis)
  859.   {
  860.       switch (uis->type) {

crypto/ui/ui_lib.c:860:5: 
  858.   int UI_get_result_maxsize(UI_STRING *uis)
  859.   {
  860. >     switch (uis->type) {
  861.       case UIT_PROMPT:
  862.       case UIT_VERIFY:

crypto/ui/ui_lib.c:861:5: Switch condition is true. Entering switch case
  859.   {
  860.       switch (uis->type) {
  861.       case UIT_PROMPT:
             ^
  862.       case UIT_VERIFY:
  863.           return uis->_.string_data.result_maxsize;

crypto/ui/ui_lib.c:863:9: 
  861.       case UIT_PROMPT:
  862.       case UIT_VERIFY:
  863. >         return uis->_.string_data.result_maxsize;
  864.       case UIT_NONE:
  865.       case UIT_INFO:

crypto/ui/ui_lib.c:871:1: return from a call to UI_get_result_maxsize
  869.       }
  870.       return -1;
  871. > }
  872.   
  873.   int UI_set_result(UI *ui, UI_STRING *uis, const char *result)

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

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