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


crypto/x509/x509_vfy.c:483:1: start of procedure check_name_constraints()
481.   }
482.   
483. > static int check_name_constraints(X509_STORE_CTX *ctx)
484.   {
485.       X509 *x;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:491:13: Taking true branch
489.           x = sk_X509_value(ctx->chain, i);
490.           /* Ignore self issued certs unless last in chain */
491.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
492.               continue;
493.           /*

crypto/x509/x509_vfy.c:491:19: Taking true branch
489.           x = sk_X509_value(ctx->chain, i);
490.           /* Ignore self issued certs unless last in chain */
491.           if (i && (x->ex_flags & EXFLAG_SI))
                         ^
492.               continue;
493.           /*

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:491:13: Taking true branch
489.           x = sk_X509_value(ctx->chain, i);
490.           /* Ignore self issued certs unless last in chain */
491.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
492.               continue;
493.           /*

crypto/x509/x509_vfy.c:491:19: Taking false branch
489.           x = sk_X509_value(ctx->chain, i);
490.           /* Ignore self issued certs unless last in chain */
491.           if (i && (x->ex_flags & EXFLAG_SI))
                         ^
492.               continue;
493.           /*

crypto/x509/x509_vfy.c:499:18: Condition is true
497.            * to be obeyed.
498.            */
499.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                        ^
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {

crypto/x509/x509_vfy.c:499:14: 
497.            * to be obeyed.
498.            */
499. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {

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

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

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

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

crypto/x509/x509_vfy.c:499:47: Loop condition is true. Entering loop body
497.            * to be obeyed.
498.            */
499.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {

crypto/x509/x509_vfy.c:500:36: Condition is true
498.            */
499.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
                                          ^
501.               if (nc) {
502.                   rv = NAME_CONSTRAINTS_check(x, nc);

crypto/x509/x509_vfy.c:500:13: 
498.            */
499.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
500. >             NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {
502.                   rv = NAME_CONSTRAINTS_check(x, nc);

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

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

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

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

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

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

crypto/x509/x509_vfy.c:501:17: Taking true branch
499.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {
                       ^
502.                   rv = NAME_CONSTRAINTS_check(x, nc);
503.                   if (rv != X509_V_OK) {

crypto/x509/x509_vfy.c:502:17: Skipping NAME_CONSTRAINTS_check(): empty list of specs
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {
502.                   rv = NAME_CONSTRAINTS_check(x, nc);
                       ^
503.                   if (rv != X509_V_OK) {
504.                       ctx->error = rv;

crypto/x509/x509_vfy.c:503:21: Taking true branch
501.               if (nc) {
502.                   rv = NAME_CONSTRAINTS_check(x, nc);
503.                   if (rv != X509_V_OK) {
                           ^
504.                       ctx->error = rv;
505.                       ctx->error_depth = i;

crypto/x509/x509_vfy.c:504:21: 
502.                   rv = NAME_CONSTRAINTS_check(x, nc);
503.                   if (rv != X509_V_OK) {
504. >                     ctx->error = rv;
505.                       ctx->error_depth = i;
506.                       ctx->current_cert = x;

crypto/x509/x509_vfy.c:505:21: 
503.                   if (rv != X509_V_OK) {
504.                       ctx->error = rv;
505. >                     ctx->error_depth = i;
506.                       ctx->current_cert = x;
507.                       if (!ctx->verify_cb(0, ctx))

crypto/x509/x509_vfy.c:506:21: 
504.                       ctx->error = rv;
505.                       ctx->error_depth = i;
506. >                     ctx->current_cert = x;
507.                       if (!ctx->verify_cb(0, ctx))
508.                           return 0;

crypto/x509/x509_vfy.c:507:26: Taking false branch
505.                       ctx->error_depth = i;
506.                       ctx->current_cert = x;
507.                       if (!ctx->verify_cb(0, ctx))
                                ^
508.                           return 0;
509.                   }

crypto/x509/x509_vfy.c:499:54: 
497.            * to be obeyed.
498.            */
499. >         for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {

crypto/x509/x509_vfy.c:499:47: Loop condition is false. Leaving loop
497.            * to be obeyed.
498.            */
499.           for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
                                                     ^
500.               NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
501.               if (nc) {

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:491:13: Taking true branch
489.           x = sk_X509_value(ctx->chain, i);
490.           /* Ignore self issued certs unless last in chain */
491.           if (i && (x->ex_flags & EXFLAG_SI))
                   ^
492.               continue;
493.           /*

crypto/x509/x509_vfy.c:491:19: 
489.           x = sk_X509_value(ctx->chain, i);
490.           /* Ignore self issued certs unless last in chain */
491. >         if (i && (x->ex_flags & EXFLAG_SI))
492.               continue;
493.           /*
