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


crypto/x509/x509_vfy.c:583:1: start of procedure check_chain_extensions()
581.    */
582.   
583. > static int check_chain_extensions(X509_STORE_CTX *ctx)
584.   {
585.       int i, ok = 0, must_be_ca, plen = 0;

crypto/x509/x509_vfy.c:585:5: 
583.   static int check_chain_extensions(X509_STORE_CTX *ctx)
584.   {
585. >     int i, ok = 0, must_be_ca, plen = 0;
586.       X509 *x;
587.       int (*cb) (int xok, X509_STORE_CTX *xctx);

crypto/x509/x509_vfy.c:588:5: 
586.       X509 *x;
587.       int (*cb) (int xok, X509_STORE_CTX *xctx);
588. >     int proxy_path_length = 0;
589.       int purpose;
590.       int allow_proxy_certs;

crypto/x509/x509_vfy.c:591:5: 
589.       int purpose;
590.       int allow_proxy_certs;
591. >     cb = ctx->verify_cb;
592.   
593.       /*-

crypto/x509/x509_vfy.c:602:5: 
600.        *     all certificates in the chain except the leaf certificate.
601.        */
602. >     must_be_ca = -1;
603.   
604.       /* CRL path validation */

crypto/x509/x509_vfy.c:605:9: Taking false branch
603.   
604.       /* CRL path validation */
605.       if (ctx->parent) {
               ^
606.           allow_proxy_certs = 0;
607.           purpose = X509_PURPOSE_CRL_SIGN;

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

crypto/x509/x509_vfy.c:610:13: 
608.       } else {
609.           allow_proxy_certs =
610. >             ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
611.           /*
612.            * A hack to keep people who don't want to modify their software

crypto/x509/x509_vfy.c:609:9: 
607.           purpose = X509_PURPOSE_CRL_SIGN;
608.       } else {
609. >         allow_proxy_certs =
610.               ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
611.           /*

crypto/x509/x509_vfy.c:615:13: Taking false branch
613.            * happy
614.            */
615.           if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
                   ^
616.               allow_proxy_certs = 1;
617.           purpose = ctx->param->purpose;

crypto/x509/x509_vfy.c:617:9: 
615.           if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
616.               allow_proxy_certs = 1;
617. >         purpose = ctx->param->purpose;
618.       }
619.   

crypto/x509/x509_vfy.c:621:10: 
619.   
620.       /* Check all untrusted certificates */
621. >     for (i = 0; i < ctx->last_untrusted; i++) {
622.           int ret;
623.           x = sk_X509_value(ctx->chain, i);

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

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

crypto/x509/x509_vfy.c:623:9: 
621.       for (i = 0; i < ctx->last_untrusted; i++) {
622.           int ret;
623. >         x = sk_X509_value(ctx->chain, i);
624.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
625.               && (x->ex_flags & EXFLAG_CRITICAL)) {

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:624:15: Taking true branch
622.           int ret;
623.           x = sk_X509_value(ctx->chain, i);
624.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
                     ^
625.               && (x->ex_flags & EXFLAG_CRITICAL)) {
626.               ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;

crypto/x509/x509_vfy.c:625:17: 
623.           x = sk_X509_value(ctx->chain, i);
624.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
625. >             && (x->ex_flags & EXFLAG_CRITICAL)) {
626.               ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
627.               ctx->error_depth = i;
