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


crypto/x509/x509_vfy.c:680:1: start of procedure check_name_constraints()
678.   }
679.   
680. > static int check_name_constraints(X509_STORE_CTX *ctx)
681.   {
682.       X509 *x;

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

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

crypto/stack/stack.c:319:1: start of procedure sk_num()
  317.   }
  318.   
  319. > int sk_num(const _STACK *st)
  320.   {
  321.       if (st == NULL)

crypto/stack/stack.c:321:9: Taking false branch
  319.   int sk_num(const _STACK *st)
  320.   {
  321.       if (st == NULL)
                 ^
  322.           return -1;
  323.       return st->num;

crypto/stack/stack.c:323:5: 
  321.       if (st == NULL)
  322.           return -1;
  323. >     return st->num;
  324.   }
  325.   

crypto/stack/stack.c:324:1: return from a call to sk_num
  322.           return -1;
  323.       return st->num;
  324. > }
  325.   
  326.   void *sk_value(const _STACK *st, int i)

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

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

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

crypto/stack/stack.c:326:1: start of procedure sk_value()
  324.   }
  325.   
  326. > void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:328:10: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                  ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:17: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                         ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:28: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:330:5: 
  328.       if (!st || (i < 0) || (i >= st->num))
  329.           return NULL;
  330. >     return st->data[i];
  331.   }
  332.   

crypto/stack/stack.c:331:1: return from a call to sk_value
  329.           return NULL;
  330.       return st->data[i];
  331. > }
  332.   
  333.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:688:13: Taking true branch
686.           x = sk_X509_value(ctx->chain, i);
687.           /* Ignore self issued certs unless last in chain */
688.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
689.               continue;
690.           /*

crypto/x509/x509_vfy.c:688:19: Taking true branch
686.           x = sk_X509_value(ctx->chain, i);
687.           /* Ignore self issued certs unless last in chain */
688.           if (i && (x->ex_flags & EXFLAG_SI))
                         ^
689.               continue;
690.           /*

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

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

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

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

crypto/stack/stack.c:326:1: start of procedure sk_value()
  324.   }
  325.   
  326. > void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:328:10: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                  ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:17: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                         ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:28: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:330:5: 
  328.       if (!st || (i < 0) || (i >= st->num))
  329.           return NULL;
  330. >     return st->data[i];
  331.   }
  332.   

crypto/stack/stack.c:331:1: return from a call to sk_value
  329.           return NULL;
  330.       return st->data[i];
  331. > }
  332.   
  333.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:688:13: Taking true branch
686.           x = sk_X509_value(ctx->chain, i);
687.           /* Ignore self issued certs unless last in chain */
688.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
689.               continue;
690.           /*

crypto/x509/x509_vfy.c:688:19: Taking false branch
686.           x = sk_X509_value(ctx->chain, i);
687.           /* Ignore self issued certs unless last in chain */
688.           if (i && (x->ex_flags & EXFLAG_SI))
                         ^
689.               continue;
690.           /*

crypto/x509/x509_vfy.c:696:18: Condition is true
694.            * to be obeyed.
695.            */
696.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                        ^
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {

crypto/x509/x509_vfy.c:696:14: 
694.            * to be obeyed.
695.            */
696. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {

crypto/stack/stack.c:319:1: start of procedure sk_num()
  317.   }
  318.   
  319. > int sk_num(const _STACK *st)
  320.   {
  321.       if (st == NULL)

crypto/stack/stack.c:321:9: Taking false branch
  319.   int sk_num(const _STACK *st)
  320.   {
  321.       if (st == NULL)
                 ^
  322.           return -1;
  323.       return st->num;

crypto/stack/stack.c:323:5: 
  321.       if (st == NULL)
  322.           return -1;
  323. >     return st->num;
  324.   }
  325.   

crypto/stack/stack.c:324:1: return from a call to sk_num
  322.           return -1;
  323.       return st->num;
  324. > }
  325.   
  326.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_vfy.c:696:47: Loop condition is true. Entering loop body
694.            * to be obeyed.
695.            */
696.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {

crypto/x509/x509_vfy.c:697:36: Condition is true
695.            */
696.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
                                          ^
698.               if (nc) {
699.                   rv = NAME_CONSTRAINTS_check(x, nc);

crypto/x509/x509_vfy.c:697:13: 
695.            */
696.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
697. >             NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {
699.                   rv = NAME_CONSTRAINTS_check(x, nc);

crypto/stack/stack.c:326:1: start of procedure sk_value()
  324.   }
  325.   
  326. > void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:328:10: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                  ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:17: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                         ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:28: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:330:5: 
  328.       if (!st || (i < 0) || (i >= st->num))
  329.           return NULL;
  330. >     return st->data[i];
  331.   }
  332.   

crypto/stack/stack.c:331:1: return from a call to sk_value
  329.           return NULL;
  330.       return st->data[i];
  331. > }
  332.   
  333.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:698:17: Taking true branch
696.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {
                       ^
699.                   rv = NAME_CONSTRAINTS_check(x, nc);
700.                   if (rv != X509_V_OK) {

crypto/x509/x509_vfy.c:699:17: Skipping NAME_CONSTRAINTS_check(): empty list of specs
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {
699.                   rv = NAME_CONSTRAINTS_check(x, nc);
                       ^
700.                   if (rv != X509_V_OK) {
701.                       ctx->error = rv;

crypto/x509/x509_vfy.c:700:21: Taking true branch
698.               if (nc) {
699.                   rv = NAME_CONSTRAINTS_check(x, nc);
700.                   if (rv != X509_V_OK) {
                           ^
701.                       ctx->error = rv;
702.                       ctx->error_depth = i;

crypto/x509/x509_vfy.c:701:21: 
699.                   rv = NAME_CONSTRAINTS_check(x, nc);
700.                   if (rv != X509_V_OK) {
701. >                     ctx->error = rv;
702.                       ctx->error_depth = i;
703.                       ctx->current_cert = x;

crypto/x509/x509_vfy.c:702:21: 
700.                   if (rv != X509_V_OK) {
701.                       ctx->error = rv;
702. >                     ctx->error_depth = i;
703.                       ctx->current_cert = x;
704.                       if (!ctx->verify_cb(0, ctx))

crypto/x509/x509_vfy.c:703:21: 
701.                       ctx->error = rv;
702.                       ctx->error_depth = i;
703. >                     ctx->current_cert = x;
704.                       if (!ctx->verify_cb(0, ctx))
705.                           return 0;

crypto/x509/x509_vfy.c:704:26: Taking false branch
702.                       ctx->error_depth = i;
703.                       ctx->current_cert = x;
704.                       if (!ctx->verify_cb(0, ctx))
                                ^
705.                           return 0;
706.                   }

crypto/x509/x509_vfy.c:696:54: 
694.            * to be obeyed.
695.            */
696. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {

crypto/x509/x509_vfy.c:696:47: Loop condition is false. Leaving loop
694.            * to be obeyed.
695.            */
696.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
697.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
698.               if (nc) {

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

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

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

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

crypto/stack/stack.c:326:1: start of procedure sk_value()
  324.   }
  325.   
  326. > void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:328:10: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                  ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:17: Taking false branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                         ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:328:28: Taking true branch
  326.   void *sk_value(const _STACK *st, int i)
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
                                    ^
  329.           return NULL;
  330.       return st->data[i];

crypto/stack/stack.c:329:9: 
  327.   {
  328.       if (!st || (i < 0) || (i >= st->num))
  329. >         return NULL;
  330.       return st->data[i];
  331.   }

crypto/stack/stack.c:331:1: return from a call to sk_value
  329.           return NULL;
  330.       return st->data[i];
  331. > }
  332.   
  333.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_vfy.c:688:13: Taking true branch
686.           x = sk_X509_value(ctx->chain, i);
687.           /* Ignore self issued certs unless last in chain */
688.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
689.               continue;
690.           /*

crypto/x509/x509_vfy.c:688:19: 
686.           x = sk_X509_value(ctx->chain, i);
687.           /* Ignore self issued certs unless last in chain */
688. >         if (i && (x->ex_flags & EXFLAG_SI))
689.               continue;
690.           /*
