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


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

crypto/x509/x509_lu.c:447:5: 
445.       int idx;
446.   
447. >     stmp.type = type;
448.       switch (type) {
449.       case X509_LU_X509:

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

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

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

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

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

include/openssl/x509_vfy.h:58:1: start of procedure sk_X509_OBJECT_find()
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/stack/stack.c:190:1: start of procedure OPENSSL_sk_find()
    188.   }
    189.   
    190. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    191.   {
    192.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);

crypto/stack/stack.c:192:5: 
    190.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
    191.   {
    192. >     return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    193.   }
    194.   

crypto/stack/stack.c:165:1: start of procedure internal_find()
      163.   }
      164.   
      165. > static int internal_find(OPENSSL_STACK *st, const void *data,
      166.                            int ret_val_options)
      167.   {

crypto/stack/stack.c:171:9: Taking false branch
      169.       int i;
      170.   
      171.       if (st == NULL)
                     ^
      172.           return -1;
      173.   

crypto/stack/stack.c:174:9: Taking true branch
      172.           return -1;
      173.   
      174.       if (st->comp == NULL) {
                     ^
      175.           for (i = 0; i < st->num; i++)
      176.               if (st->data[i] == data)

crypto/stack/stack.c:175:14: 
      173.   
      174.       if (st->comp == NULL) {
      175. >         for (i = 0; i < st->num; i++)
      176.               if (st->data[i] == data)
      177.                   return (i);

crypto/stack/stack.c:175:21: Loop condition is true. Entering loop body
      173.   
      174.       if (st->comp == NULL) {
      175.           for (i = 0; i < st->num; i++)
                                 ^
      176.               if (st->data[i] == data)
      177.                   return (i);

crypto/stack/stack.c:176:17: Taking false branch
      174.       if (st->comp == NULL) {
      175.           for (i = 0; i < st->num; i++)
      176.               if (st->data[i] == data)
                             ^
      177.                   return (i);
      178.           return (-1);

crypto/stack/stack.c:175:34: 
      173.   
      174.       if (st->comp == NULL) {
      175. >         for (i = 0; i < st->num; i++)
      176.               if (st->data[i] == data)
      177.                   return (i);

crypto/stack/stack.c:175:21: Loop condition is true. Entering loop body
      173.   
      174.       if (st->comp == NULL) {
      175.           for (i = 0; i < st->num; i++)
                                 ^
      176.               if (st->data[i] == data)
      177.                   return (i);

crypto/stack/stack.c:176:17: Taking true branch
      174.       if (st->comp == NULL) {
      175.           for (i = 0; i < st->num; i++)
      176.               if (st->data[i] == data)
                             ^
      177.                   return (i);
      178.           return (-1);

crypto/stack/stack.c:177:17: 
      175.           for (i = 0; i < st->num; i++)
      176.               if (st->data[i] == data)
      177. >                 return (i);
      178.           return (-1);
      179.       }

crypto/stack/stack.c:188:1: return from a call to internal_find
      186.           return (-1);
      187.       return (int)((const char **)r - st->data);
      188. > }
      189.   
      190.   int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)

crypto/stack/stack.c:193:1: return from a call to OPENSSL_sk_find
    191.   {
    192.       return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
    193. > }
    194.   
    195.   int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)

include/openssl/x509_vfy.h:58:1: return from a call to sk_X509_OBJECT_find
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

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

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

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

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

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

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

include/openssl/x509_vfy.h:58:1: start of procedure sk_X509_OBJECT_num()
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/stack/stack.c:258:1: start of procedure OPENSSL_sk_num()
    256.   }
    257.   
    258. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    259.   {
    260.       if (st == NULL)

crypto/stack/stack.c:260:9: Taking false branch
    258.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    259.   {
    260.       if (st == NULL)
                   ^
    261.           return -1;
    262.       return st->num;

crypto/stack/stack.c:262:5: 
    260.       if (st == NULL)
    261.           return -1;
    262. >     return st->num;
    263.   }
    264.   

crypto/stack/stack.c:263:1: return from a call to OPENSSL_sk_num
    261.           return -1;
    262.       return st->num;
    263. > }
    264.   
    265.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

include/openssl/x509_vfy.h:58:1: return from a call to sk_X509_OBJECT_num
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

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

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

include/openssl/x509_vfy.h:58:1: start of procedure sk_X509_OBJECT_value()
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_value()
    263.   }
    264.   
    265. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    266.   {
    267.       if (st == NULL || i < 0 || i >= st->num)

crypto/stack/stack.c:267:9: Taking false branch
    265.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    266.   {
    267.       if (st == NULL || i < 0 || i >= st->num)
                   ^
    268.           return NULL;
    269.       return (void *)st->data[i];

crypto/stack/stack.c:267:23: Taking true branch
    265.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
    266.   {
    267.       if (st == NULL || i < 0 || i >= st->num)
                                 ^
    268.           return NULL;
    269.       return (void *)st->data[i];

crypto/stack/stack.c:268:9: 
    266.   {
    267.       if (st == NULL || i < 0 || i >= st->num)
    268. >         return NULL;
    269.       return (void *)st->data[i];
    270.   }

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

include/openssl/x509_vfy.h:58:1: return from a call to sk_X509_OBJECT_value
  56.   
  57.   DEFINE_STACK_OF(X509_LOOKUP)
  58. > DEFINE_STACK_OF(X509_OBJECT)
  59.   DEFINE_STACK_OF(X509_VERIFY_PARAM)
  60.   

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

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

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