crypto/x509/x509_lu.c:473: error: NULL_DEREFERENCE
  pointer `&tobj` last assigned on line 472 could be null and is dereferenced by call to `x509_object_cmp()` at line 473, column 17.
Showing all 47 steps of the trace


crypto/x509/x509_lu.c:442:1: start of procedure x509_object_idx_cnt()
440.   }
441.   
442. > static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type,
443.                                  X509_NAME *name, int *pnmatch)
444.   {

crypto/x509/x509_lu.c:450:5: 
448.       int idx;
449.   
450. >     stmp.type = type;
451.       switch (type) {
452.       case X509_LU_X509:

crypto/x509/x509_lu.c:451:5: 
449.   
450.       stmp.type = type;
451. >     switch (type) {
452.       case X509_LU_X509:
453.           stmp.data.x509 = &x509_s;

crypto/x509/x509_lu.c:452:5: Switch condition is true. Entering switch case
450.       stmp.type = type;
451.       switch (type) {
452.       case X509_LU_X509:
           ^
453.           stmp.data.x509 = &x509_s;
454.           x509_s.cert_info.subject = name;

crypto/x509/x509_lu.c:453:9: 
451.       switch (type) {
452.       case X509_LU_X509:
453. >         stmp.data.x509 = &x509_s;
454.           x509_s.cert_info.subject = name;
455.           break;

crypto/x509/x509_lu.c:454:9: 
452.       case X509_LU_X509:
453.           stmp.data.x509 = &x509_s;
454. >         x509_s.cert_info.subject = name;
455.           break;
456.       case X509_LU_CRL:

crypto/x509/x509_lu.c:465:5: 
463.       }
464.   
465. >     idx = sk_X509_OBJECT_find(h, &stmp);
466.       if (idx >= 0 && pnmatch) {
467.           int tidx;

include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_find()
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/stack/stack.c:197:1: start of procedure OPENSSL_sk_find()
    195.   }
    196.   
    197. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    198.   {
    199.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:199:5: 
    197.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    198.   {
    199. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    200.   }
    201.   

crypto/stack/stack.c:172:1: start of procedure internal_find()
      170.   }
      171.   
      172. > static int internal_find(OPENSSL_STACK *st, const void *data,
      173.                            int ret_val_options)
      174.   {

crypto/stack/stack.c:178:9: Taking false branch
      176.       int i;
      177.   
      178.       if (st == NULL)
                     ^
      179.           return -1;
      180.   

crypto/stack/stack.c:181:9: Taking true branch
      179.           return -1;
      180.   
      181.       if (st->comp == NULL) {
                     ^
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)

crypto/stack/stack.c:182:14: 
      180.   
      181.       if (st->comp == NULL) {
      182. >         for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
      180.   
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
                                 ^
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:183:17: Taking false branch
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
                             ^
      184.                   return (i);
      185.           return (-1);

crypto/stack/stack.c:182:34: 
      180.   
      181.       if (st->comp == NULL) {
      182. >         for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
      180.   
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
                                 ^
      183.               if (st->data[i] == data)
      184.                   return (i);

crypto/stack/stack.c:183:17: Taking true branch
      181.       if (st->comp == NULL) {
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
                             ^
      184.                   return (i);
      185.           return (-1);

crypto/stack/stack.c:184:17: 
      182.           for (i = 0; i < st->num; i++)
      183.               if (st->data[i] == data)
      184. >                 return (i);
      185.           return (-1);
      186.       }

crypto/stack/stack.c:195:1: return from a call to internal_find
      193.           return (-1);
      194.       return (int)((char **)r - st->data);
      195. > }
      196.   
      197.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

crypto/stack/stack.c:200:1: return from a call to OPENSSL_sk_find
    198.   {
    199.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    200. > }
    201.   
    202.   int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)

include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_find
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/x509/x509_lu.c:466:9: Taking true branch
464.   
465.       idx = sk_X509_OBJECT_find(h, &stmp);
466.       if (idx >= 0 && pnmatch) {
               ^
467.           int tidx;
468.           const X509_OBJECT *tobj, *pstmp;

crypto/x509/x509_lu.c:466:21: Taking true branch
464.   
465.       idx = sk_X509_OBJECT_find(h, &stmp);
466.       if (idx >= 0 && pnmatch) {
                           ^
467.           int tidx;
468.           const X509_OBJECT *tobj, *pstmp;

crypto/x509/x509_lu.c:469:9: 
467.           int tidx;
468.           const X509_OBJECT *tobj, *pstmp;
469. >         *pnmatch = 1;
470.           pstmp = &stmp;
471.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {

crypto/x509/x509_lu.c:470:9: 
468.           const X509_OBJECT *tobj, *pstmp;
469.           *pnmatch = 1;
470. >         pstmp = &stmp;
471.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
472.               tobj = sk_X509_OBJECT_value(h, tidx);

crypto/x509/x509_lu.c:471:14: 
469.           *pnmatch = 1;
470.           pstmp = &stmp;
471. >         for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
472.               tobj = sk_X509_OBJECT_value(h, tidx);
473.               if (x509_object_cmp(&tobj, &pstmp))

crypto/x509/x509_lu.c:471:30: 
469.           *pnmatch = 1;
470.           pstmp = &stmp;
471. >         for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
472.               tobj = sk_X509_OBJECT_value(h, tidx);
473.               if (x509_object_cmp(&tobj, &pstmp))

include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_num()
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_num()
    263.   }
    264.   
    265. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)

crypto/stack/stack.c:267:9: Taking false branch
    265.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    266.   {
    267.       if (st == NULL)
                   ^
    268.           return -1;
    269.       return st->num;

crypto/stack/stack.c:269:5: 
    267.       if (st == NULL)
    268.           return -1;
    269. >     return st->num;
    270.   }
    271.   

crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_num
    268.           return -1;
    269.       return st->num;
    270. > }
    271.   
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_num
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/x509/x509_lu.c:471:30: Loop condition is true. Entering loop body
469.           *pnmatch = 1;
470.           pstmp = &stmp;
471.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
                                    ^
472.               tobj = sk_X509_OBJECT_value(h, tidx);
473.               if (x509_object_cmp(&tobj, &pstmp))

crypto/x509/x509_lu.c:472:13: 
470.           pstmp = &stmp;
471.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
472. >             tobj = sk_X509_OBJECT_value(h, tidx);
473.               if (x509_object_cmp(&tobj, &pstmp))
474.                   break;

include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_value()
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/stack/stack.c:272:1: start of procedure OPENSSL_sk_value()
    270.   }
    271.   
    272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:274:9: Taking false branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:274:23: Taking true branch
    272.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    275.           return NULL;
    276.       return st->data[i];

crypto/stack/stack.c:275:9: 
    273.   {
    274.       if (st == NULL || i < 0 || i >= st->num)
    275. >         return NULL;
    276.       return st->data[i];
    277.   }

crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value
    275.           return NULL;
    276.       return st->data[i];
    277. > }
    278.   
    279.   void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value)

include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_value
  52.   
  53.   DEFINE_STACK_OF(X509_LOOKUP)
  54. > DEFINE_STACK_OF(X509_OBJECT)
  55.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  56.   

crypto/x509/x509_lu.c:473:17: 
471.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
472.               tobj = sk_X509_OBJECT_value(h, tidx);
473. >             if (x509_object_cmp(&tobj, &pstmp))
474.                   break;
475.               (*pnmatch)++;

crypto/x509/x509_lu.c:119:1: start of procedure x509_object_cmp()
  117.   }
  118.   
  119. > static int x509_object_cmp(const X509_OBJECT *const *a,
  120.                              const X509_OBJECT *const *b)
  121.   {

crypto/x509/x509_lu.c:124:5: 
  122.       int ret;
  123.   
  124. >     ret = ((*a)->type - (*b)->type);
  125.       if (ret)
  126.           return ret;
