crypto/x509/x509_vfy.c:694: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 692 could be null and is dereferenced at line 694, column 19.
Showing all 66 steps of the trace


crypto/x509/x509_vfy.c:686:1: start of procedure check_name_constraints()
684.   }
685.   
686. > static int check_name_constraints(X509_STORE_CTX *ctx)
687.   {
688.       X509 *x;

crypto/x509/x509_vfy.c:691:14: Condition is true
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
                    ^
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/x509/x509_vfy.c:691:10: 
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691. >     for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/stack/stack.c:340:1: start of procedure sk_num()
  338.   }
  339.   
  340. > int sk_num(const _STACK *st)
  341.   {
  342.       if (st == NULL)

crypto/stack/stack.c:342:9: Taking false branch
  340.   int sk_num(const _STACK *st)
  341.   {
  342.       if (st == NULL)
                 ^
  343.           return -1;
  344.       return st->num;

crypto/stack/stack.c:344:5: 
  342.       if (st == NULL)
  343.           return -1;
  344. >     return st->num;
  345.   }
  346.   

crypto/stack/stack.c:345:1: return from a call to sk_num
  343.           return -1;
  344.       return st->num;
  345. > }
  346.   
  347.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:691:43: Loop condition is true. Entering loop body
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
                                                 ^
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/x509/x509_vfy.c:692:13: Condition is true
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692.           x = sk_X509_value(ctx->chain, i);
                   ^
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))

crypto/x509/x509_vfy.c:692:9: 
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692. >         x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))

crypto/stack/stack.c:347:1: start of procedure sk_value()
  345.   }
  346.   
  347. > void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                  ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                         ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:351:5: 
  349.       if (!st || (i < 0) || (i >= st->num))
  350.           return NULL;
  351. >     return st->data[i];
  352.   }
  353.   

crypto/stack/stack.c:352:1: return from a call to sk_value
  350.           return NULL;
  351.       return st->data[i];
  352. > }
  353.   
  354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:694:13: Taking true branch
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
695.               continue;
696.           /*

crypto/x509/x509_vfy.c:694:19: Taking true branch
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))
                         ^
695.               continue;
696.           /*

crypto/x509/x509_vfy.c:691:51: 
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691. >     for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/x509/x509_vfy.c:691:43: Loop condition is true. Entering loop body
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
                                                 ^
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/x509/x509_vfy.c:692:13: Condition is true
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692.           x = sk_X509_value(ctx->chain, i);
                   ^
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))

crypto/x509/x509_vfy.c:692:9: 
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692. >         x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))

crypto/stack/stack.c:347:1: start of procedure sk_value()
  345.   }
  346.   
  347. > void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                  ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                         ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:351:5: 
  349.       if (!st || (i < 0) || (i >= st->num))
  350.           return NULL;
  351. >     return st->data[i];
  352.   }
  353.   

crypto/stack/stack.c:352:1: return from a call to sk_value
  350.           return NULL;
  351.       return st->data[i];
  352. > }
  353.   
  354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:694:13: Taking true branch
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
695.               continue;
696.           /*

crypto/x509/x509_vfy.c:694:19: Taking false branch
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))
                         ^
695.               continue;
696.           /*

crypto/x509/x509_vfy.c:702:18: Condition is true
700.            * to be obeyed.
701.            */
702.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                        ^
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {

crypto/x509/x509_vfy.c:702:14: 
700.            * to be obeyed.
701.            */
702. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {

crypto/stack/stack.c:340:1: start of procedure sk_num()
  338.   }
  339.   
  340. > int sk_num(const _STACK *st)
  341.   {
  342.       if (st == NULL)

crypto/stack/stack.c:342:9: Taking false branch
  340.   int sk_num(const _STACK *st)
  341.   {
  342.       if (st == NULL)
                 ^
  343.           return -1;
  344.       return st->num;

crypto/stack/stack.c:344:5: 
  342.       if (st == NULL)
  343.           return -1;
  344. >     return st->num;
  345.   }
  346.   

crypto/stack/stack.c:345:1: return from a call to sk_num
  343.           return -1;
  344.       return st->num;
  345. > }
  346.   
  347.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:702:47: Loop condition is true. Entering loop body
700.            * to be obeyed.
701.            */
702.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {

crypto/x509/x509_vfy.c:703:36: Condition is true
701.            */
702.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
                                          ^
704.               if (nc) {
705.                   rv = NAME_CONSTRAINTS_check(x, nc);

crypto/x509/x509_vfy.c:703:13: 
701.            */
702.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
703. >             NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {
705.                   rv = NAME_CONSTRAINTS_check(x, nc);

crypto/stack/stack.c:347:1: start of procedure sk_value()
  345.   }
  346.   
  347. > void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                  ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                         ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:351:5: 
  349.       if (!st || (i < 0) || (i >= st->num))
  350.           return NULL;
  351. >     return st->data[i];
  352.   }
  353.   

crypto/stack/stack.c:352:1: return from a call to sk_value
  350.           return NULL;
  351.       return st->data[i];
  352. > }
  353.   
  354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:704:17: Taking true branch
702.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {
                       ^
705.                   rv = NAME_CONSTRAINTS_check(x, nc);
706.                   if (rv != X509_V_OK) {

crypto/x509/x509_vfy.c:705:17: Skipping NAME_CONSTRAINTS_check(): empty list of specs
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {
705.                   rv = NAME_CONSTRAINTS_check(x, nc);
                       ^
706.                   if (rv != X509_V_OK) {
707.                       ctx->error = rv;

crypto/x509/x509_vfy.c:706:21: Taking true branch
704.               if (nc) {
705.                   rv = NAME_CONSTRAINTS_check(x, nc);
706.                   if (rv != X509_V_OK) {
                           ^
707.                       ctx->error = rv;
708.                       ctx->error_depth = i;

crypto/x509/x509_vfy.c:707:21: 
705.                   rv = NAME_CONSTRAINTS_check(x, nc);
706.                   if (rv != X509_V_OK) {
707. >                     ctx->error = rv;
708.                       ctx->error_depth = i;
709.                       ctx->current_cert = x;

crypto/x509/x509_vfy.c:708:21: 
706.                   if (rv != X509_V_OK) {
707.                       ctx->error = rv;
708. >                     ctx->error_depth = i;
709.                       ctx->current_cert = x;
710.                       if (!ctx->verify_cb(0, ctx))

crypto/x509/x509_vfy.c:709:21: 
707.                       ctx->error = rv;
708.                       ctx->error_depth = i;
709. >                     ctx->current_cert = x;
710.                       if (!ctx->verify_cb(0, ctx))
711.                           return 0;

crypto/x509/x509_vfy.c:710:26: Taking false branch
708.                       ctx->error_depth = i;
709.                       ctx->current_cert = x;
710.                       if (!ctx->verify_cb(0, ctx))
                                ^
711.                           return 0;
712.                   }

crypto/x509/x509_vfy.c:702:54: 
700.            * to be obeyed.
701.            */
702. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {

crypto/x509/x509_vfy.c:702:47: Loop condition is false. Leaving loop
700.            * to be obeyed.
701.            */
702.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
703.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
704.               if (nc) {

crypto/x509/x509_vfy.c:691:51: 
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691. >     for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/x509/x509_vfy.c:691:43: Loop condition is true. Entering loop body
689.       int i, j, rv;
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
                                                 ^
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */

crypto/x509/x509_vfy.c:692:13: Condition is true
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692.           x = sk_X509_value(ctx->chain, i);
                   ^
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))

crypto/x509/x509_vfy.c:692:9: 
690.       /* Check name constraints for all certificates */
691.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
692. >         x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))

crypto/stack/stack.c:347:1: start of procedure sk_value()
  345.   }
  346.   
  347. > void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:349:10: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                  ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:17: Taking false branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                         ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:349:28: Taking true branch
  347.   void *sk_value(const _STACK *st, int i)
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  350.           return NULL;
  351.       return st->data[i];

crypto/stack/stack.c:350:9: 
  348.   {
  349.       if (!st || (i < 0) || (i >= st->num))
  350. >         return NULL;
  351.       return st->data[i];
  352.   }

crypto/stack/stack.c:352:1: return from a call to sk_value
  350.           return NULL;
  351.       return st->data[i];
  352. > }
  353.   
  354.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:694:13: Taking true branch
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
695.               continue;
696.           /*

crypto/x509/x509_vfy.c:694:19: 
692.           x = sk_X509_value(ctx->chain, i);
693.           /* Ignore self issued certs unless last in chain */
694. >         if (i && (x->ex_flags & EXFLAG_SI))
695.               continue;
696.           /*
