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


crypto/x509/x509_lu.c:432:1: start of procedure x509_object_idx_cnt()
430.   }
431.   
432. > static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type,
433.                                  X509_NAME *name, int *pnmatch)
434.   {

crypto/x509/x509_lu.c:440:5: 
438.       int idx;
439.   
440. >     stmp.type = type;
441.       switch (type) {
442.       case X509_LU_X509:

crypto/x509/x509_lu.c:441:5: 
439.   
440.       stmp.type = type;
441. >     switch (type) {
442.       case X509_LU_X509:
443.           stmp.data.x509 = &x509_s;

crypto/x509/x509_lu.c:442:5: Switch condition is true. Entering switch case
440.       stmp.type = type;
441.       switch (type) {
442.       case X509_LU_X509:
           ^
443.           stmp.data.x509 = &x509_s;
444.           x509_s.cert_info.subject = name;

crypto/x509/x509_lu.c:443:9: 
441.       switch (type) {
442.       case X509_LU_X509:
443. >         stmp.data.x509 = &x509_s;
444.           x509_s.cert_info.subject = name;
445.           break;

crypto/x509/x509_lu.c:444:9: 
442.       case X509_LU_X509:
443.           stmp.data.x509 = &x509_s;
444. >         x509_s.cert_info.subject = name;
445.           break;
446.       case X509_LU_CRL:

crypto/x509/x509_lu.c:455:5: 
453.       }
454.   
455. >     idx = sk_X509_OBJECT_find(h, &stmp);
456.       if (idx >= 0 && pnmatch) {
457.           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:456:9: Taking true branch
454.   
455.       idx = sk_X509_OBJECT_find(h, &stmp);
456.       if (idx >= 0 && pnmatch) {
               ^
457.           int tidx;
458.           const X509_OBJECT *tobj, *pstmp;

crypto/x509/x509_lu.c:456:21: Taking true branch
454.   
455.       idx = sk_X509_OBJECT_find(h, &stmp);
456.       if (idx >= 0 && pnmatch) {
                           ^
457.           int tidx;
458.           const X509_OBJECT *tobj, *pstmp;

crypto/x509/x509_lu.c:459:9: 
457.           int tidx;
458.           const X509_OBJECT *tobj, *pstmp;
459. >         *pnmatch = 1;
460.           pstmp = &stmp;
461.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {

crypto/x509/x509_lu.c:460:9: 
458.           const X509_OBJECT *tobj, *pstmp;
459.           *pnmatch = 1;
460. >         pstmp = &stmp;
461.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462.               tobj = sk_X509_OBJECT_value(h, tidx);

crypto/x509/x509_lu.c:461:14: 
459.           *pnmatch = 1;
460.           pstmp = &stmp;
461. >         for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462.               tobj = sk_X509_OBJECT_value(h, tidx);
463.               if (x509_object_cmp(&tobj, &pstmp))

crypto/x509/x509_lu.c:461:30: 
459.           *pnmatch = 1;
460.           pstmp = &stmp;
461. >         for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462.               tobj = sk_X509_OBJECT_value(h, tidx);
463.               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:461:30: Loop condition is true. Entering loop body
459.           *pnmatch = 1;
460.           pstmp = &stmp;
461.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
                                    ^
462.               tobj = sk_X509_OBJECT_value(h, tidx);
463.               if (x509_object_cmp(&tobj, &pstmp))

crypto/x509/x509_lu.c:462:13: 
460.           pstmp = &stmp;
461.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462. >             tobj = sk_X509_OBJECT_value(h, tidx);
463.               if (x509_object_cmp(&tobj, &pstmp))
464.                   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:463:17: 
461.           for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462.               tobj = sk_X509_OBJECT_value(h, tidx);
463. >             if (x509_object_cmp(&tobj, &pstmp))
464.                   break;
465.               (*pnmatch)++;

crypto/x509/x509_lu.c:109:1: start of procedure x509_object_cmp()
  107.   }
  108.   
  109. > static int x509_object_cmp(const X509_OBJECT *const *a,
  110.                              const X509_OBJECT *const *b)
  111.   {

crypto/x509/x509_lu.c:114:5: 
  112.       int ret;
  113.   
  114. >     ret = ((*a)->type - (*b)->type);
  115.       if (ret)
  116.           return ret;
