crypto/x509v3/v3_purp.c:91: error: NULL_DEREFERENCE
  pointer `pt` last assigned on line 90 could be null and is dereferenced at line 91, column 12.
Showing all 11 steps of the trace


crypto/x509v3/v3_purp.c:77:1: start of procedure X509_check_purpose()
75.    * things.
76.    */
77. > int X509_check_purpose(X509 *x, int id, int ca)
78.   {
79.       int idx;

crypto/x509v3/v3_purp.c:82:5: Skipping x509v3_cache_extensions(): empty list of specs
80.       const X509_PURPOSE *pt;
81.   
82.       x509v3_cache_extensions(x);
          ^
83.   
84.       /* Return if side-effect only call */

crypto/x509v3/v3_purp.c:85:9: Taking false branch
83.   
84.       /* Return if side-effect only call */
85.       if (id == -1)
              ^
86.           return 1;
87.       idx = X509_PURPOSE_get_by_id(id);

crypto/x509v3/v3_purp.c:87:5: Skipping X509_PURPOSE_get_by_id(): empty list of specs
85.       if (id == -1)
86.           return 1;
87.       idx = X509_PURPOSE_get_by_id(id);
          ^
88.       if (idx == -1)
89.           return -1;

crypto/x509v3/v3_purp.c:88:9: Taking false branch
86.           return 1;
87.       idx = X509_PURPOSE_get_by_id(id);
88.       if (idx == -1)
              ^
89.           return -1;
90.       pt = X509_PURPOSE_get0(idx);

crypto/x509v3/v3_purp.c:90:5: 
88.       if (idx == -1)
89.           return -1;
90. >     pt = X509_PURPOSE_get0(idx);
91.       return pt->check_purpose(pt, x, ca);
92.   }

crypto/x509v3/v3_purp.c:111:1: start of procedure X509_PURPOSE_get0()
  109.   }
  110.   
  111. > X509_PURPOSE *X509_PURPOSE_get0(int idx)
  112.   {
  113.       if (idx < 0)

crypto/x509v3/v3_purp.c:113:9: Taking true branch
  111.   X509_PURPOSE *X509_PURPOSE_get0(int idx)
  112.   {
  113.       if (idx < 0)
                 ^
  114.           return NULL;
  115.       if (idx < (int)X509_PURPOSE_COUNT)

crypto/x509v3/v3_purp.c:114:9: 
  112.   {
  113.       if (idx < 0)
  114. >         return NULL;
  115.       if (idx < (int)X509_PURPOSE_COUNT)
  116.           return xstandard + idx;

crypto/x509v3/v3_purp.c:118:1: return from a call to X509_PURPOSE_get0
  116.           return xstandard + idx;
  117.       return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT);
  118. > }
  119.   
  120.   int X509_PURPOSE_get_by_sname(const char *sname)

crypto/x509v3/v3_purp.c:91:5: 
89.           return -1;
90.       pt = X509_PURPOSE_get0(idx);
91. >     return pt->check_purpose(pt, x, ca);
92.   }
93.   
