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


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

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

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

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

crypto/x509/x509_vfy.c:688:9: 
686.       /* Check name constraints for all certificates */
687.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
688. >         x = sk_X509_value(ctx->chain, i);
689.           /* Ignore self issued certs unless last in chain */
690.           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:690:13: Taking true branch
688.           x = sk_X509_value(ctx->chain, i);
689.           /* Ignore self issued certs unless last in chain */
690.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
691.               continue;
692.           /*

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

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

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

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

crypto/x509/x509_vfy.c:688:9: 
686.       /* Check name constraints for all certificates */
687.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
688. >         x = sk_X509_value(ctx->chain, i);
689.           /* Ignore self issued certs unless last in chain */
690.           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:690:13: Taking true branch
688.           x = sk_X509_value(ctx->chain, i);
689.           /* Ignore self issued certs unless last in chain */
690.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
691.               continue;
692.           /*

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

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

crypto/x509/x509_vfy.c:698:14: 
696.            * to be obeyed.
697.            */
698. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
699.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
700.               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:698:47: Loop condition is true. Entering loop body
696.            * to be obeyed.
697.            */
698.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
699.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
700.               if (nc) {

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:688:9: 
686.       /* Check name constraints for all certificates */
687.       for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
688. >         x = sk_X509_value(ctx->chain, i);
689.           /* Ignore self issued certs unless last in chain */
690.           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:690:13: Taking true branch
688.           x = sk_X509_value(ctx->chain, i);
689.           /* Ignore self issued certs unless last in chain */
690.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
691.               continue;
692.           /*

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