crypto/x509/x509_vfy.c:610: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 608 could be null and is dereferenced at line 610, column 17.
Showing all 23 steps of the trace


crypto/x509/x509_vfy.c:568:1: start of procedure check_chain_extensions()
566.    */
567.   
568. > static int check_chain_extensions(X509_STORE_CTX *ctx)
569.   {
570.       int i, ok = 0, must_be_ca, plen = 0;

crypto/x509/x509_vfy.c:570:5: 
568.   static int check_chain_extensions(X509_STORE_CTX *ctx)
569.   {
570. >     int i, ok = 0, must_be_ca, plen = 0;
571.       X509 *x;
572.       int (*cb) (int xok, X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:573:5: 
571.       X509 *x;
572.       int (*cb) (int xok, X509_STORE_CTX *xctx);
573. >     int proxy_path_length = 0;
574.       int purpose;
575.       int allow_proxy_certs;

crypto/x509/x509_vfy.c:576:5: 
574.       int purpose;
575.       int allow_proxy_certs;
576. >     cb = ctx->verify_cb;
577.   
578.       /*-

crypto/x509/x509_vfy.c:587:5: 
585.        *     all certificates in the chain except the leaf certificate.
586.        */
587. >     must_be_ca = -1;
588.   
589.       /* CRL path validation */

crypto/x509/x509_vfy.c:590:9: Taking false branch
588.   
589.       /* CRL path validation */
590.       if (ctx->parent) {
               ^
591.           allow_proxy_certs = 0;
592.           purpose = X509_PURPOSE_CRL_SIGN;

crypto/x509/x509_vfy.c:595:17: Condition is true
593.       } else {
594.           allow_proxy_certs =
595.               ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
                       ^
596.           /*
597.            * A hack to keep people who don't want to modify their software

crypto/x509/x509_vfy.c:595:13: 
593.       } else {
594.           allow_proxy_certs =
595. >             ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
596.           /*
597.            * A hack to keep people who don't want to modify their software

crypto/x509/x509_vfy.c:594:9: 
592.           purpose = X509_PURPOSE_CRL_SIGN;
593.       } else {
594. >         allow_proxy_certs =
595.               ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
596.           /*

crypto/x509/x509_vfy.c:600:13: Taking false branch
598.            * happy
599.            */
600.           if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
                   ^
601.               allow_proxy_certs = 1;
602.           purpose = ctx->param->purpose;

crypto/x509/x509_vfy.c:602:9: 
600.           if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
601.               allow_proxy_certs = 1;
602. >         purpose = ctx->param->purpose;
603.       }
604.   

crypto/x509/x509_vfy.c:606:10: 
604.   
605.       /* Check all untrusted certificates */
606. >     for (i = 0; i < ctx->last_untrusted; i++) {
607.           int ret;
608.           x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:606:17: Loop condition is true. Entering loop body
604.   
605.       /* Check all untrusted certificates */
606.       for (i = 0; i < ctx->last_untrusted; i++) {
                       ^
607.           int ret;
608.           x = sk_X509_value(ctx->chain, i);

crypto/x509/x509_vfy.c:608:13: Condition is true
606.       for (i = 0; i < ctx->last_untrusted; i++) {
607.           int ret;
608.           x = sk_X509_value(ctx->chain, i);
                   ^
609.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
610.               && (x->ex_flags & EXFLAG_CRITICAL)) {

crypto/x509/x509_vfy.c:608:9: 
606.       for (i = 0; i < ctx->last_untrusted; i++) {
607.           int ret;
608. >         x = sk_X509_value(ctx->chain, i);
609.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
610.               && (x->ex_flags & EXFLAG_CRITICAL)) {

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:609:15: Taking true branch
607.           int ret;
608.           x = sk_X509_value(ctx->chain, i);
609.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
                     ^
610.               && (x->ex_flags & EXFLAG_CRITICAL)) {
611.               ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;

crypto/x509/x509_vfy.c:610:17: 
608.           x = sk_X509_value(ctx->chain, i);
609.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
610. >             && (x->ex_flags & EXFLAG_CRITICAL)) {
611.               ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
612.               ctx->error_depth = i;
