crypto/x509/x509_vfy.c:629: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 619 could be null and is dereferenced at line 629, column 36.
Showing all 24 steps of the trace


crypto/x509/x509_vfy.c:579:1: start of procedure check_chain_extensions()
577.    */
578.   
579. > static int check_chain_extensions(X509_STORE_CTX *ctx)
580.   {
581.       int i, ok = 0, must_be_ca, plen = 0;

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

crypto/x509/x509_vfy.c:584:5: 
582.       X509 *x;
583.       int (*cb) (int xok, X509_STORE_CTX *xctx);
584. >     int proxy_path_length = 0;
585.       int purpose;
586.       int allow_proxy_certs;

crypto/x509/x509_vfy.c:587:5: 
585.       int purpose;
586.       int allow_proxy_certs;
587. >     cb = ctx->verify_cb;
588.   
589.       /*-

crypto/x509/x509_vfy.c:598:5: 
596.        *     all certificates in the chain except the leaf certificate.
597.        */
598. >     must_be_ca = -1;
599.   
600.       /* CRL path validation */

crypto/x509/x509_vfy.c:601:9: Taking false branch
599.   
600.       /* CRL path validation */
601.       if (ctx->parent) {
               ^
602.           allow_proxy_certs = 0;
603.           purpose = X509_PURPOSE_CRL_SIGN;

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

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

crypto/x509/x509_vfy.c:605:9: 
603.           purpose = X509_PURPOSE_CRL_SIGN;
604.       } else {
605. >         allow_proxy_certs =
606.               ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
607.           /*

crypto/x509/x509_vfy.c:611:13: Taking false branch
609.            * happy
610.            */
611.           if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
                   ^
612.               allow_proxy_certs = 1;
613.           purpose = ctx->param->purpose;

crypto/x509/x509_vfy.c:613:9: 
611.           if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
612.               allow_proxy_certs = 1;
613. >         purpose = ctx->param->purpose;
614.       }
615.   

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

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

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

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

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

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

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

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

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

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

crypto/x509/x509_vfy.c:620:15: Taking false branch
618.           int ret;
619.           x = sk_X509_value(ctx->chain, i);
620.           if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
                     ^
621.               && (x->ex_flags & EXFLAG_CRITICAL)) {
622.               ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;

crypto/x509/x509_vfy.c:629:14: Taking true branch
627.                   goto end;
628.           }
629.           if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) {
                    ^
630.               ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
631.               ctx->error_depth = i;

crypto/x509/x509_vfy.c:629:36: 
627.                   goto end;
628.           }
629. >         if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) {
630.               ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
631.               ctx->error_depth = i;
