apps/s_server.c:493: error: NULL_DEREFERENCE
  pointer `x` last assigned on line 492 could be null and is dereferenced by call to `X509_get1_ocsp()` at line 493, column 11.
Showing all 14 steps of the trace


apps/s_server.c:476:1: start of procedure get_ocsp_resp_from_responder()
474.    * them until they were considered "expired".
475.    */
476. > static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx,
477.                                           OCSP_RESPONSE **resp)
478.   {

apps/s_server.c:479:5: 
477.                                           OCSP_RESPONSE **resp)
478.   {
479. >     char *host = NULL, *port = NULL, *path = NULL;
480.       int use_ssl;
481.       STACK_OF(OPENSSL_STRING) *aia = NULL;

apps/s_server.c:481:5: 
479.       char *host = NULL, *port = NULL, *path = NULL;
480.       int use_ssl;
481. >     STACK_OF(OPENSSL_STRING) *aia = NULL;
482.       X509 *x = NULL;
483.       X509_STORE_CTX *inctx = NULL;

apps/s_server.c:482:5: 
480.       int use_ssl;
481.       STACK_OF(OPENSSL_STRING) *aia = NULL;
482. >     X509 *x = NULL;
483.       X509_STORE_CTX *inctx = NULL;
484.       X509_OBJECT *obj;

apps/s_server.c:483:5: 
481.       STACK_OF(OPENSSL_STRING) *aia = NULL;
482.       X509 *x = NULL;
483. >     X509_STORE_CTX *inctx = NULL;
484.       X509_OBJECT *obj;
485.       OCSP_REQUEST *req = NULL;

apps/s_server.c:485:5: 
483.       X509_STORE_CTX *inctx = NULL;
484.       X509_OBJECT *obj;
485. >     OCSP_REQUEST *req = NULL;
486.       OCSP_CERTID *id = NULL;
487.       STACK_OF(X509_EXTENSION) *exts;

apps/s_server.c:486:5: 
484.       X509_OBJECT *obj;
485.       OCSP_REQUEST *req = NULL;
486. >     OCSP_CERTID *id = NULL;
487.       STACK_OF(X509_EXTENSION) *exts;
488.       int ret = SSL_TLSEXT_ERR_NOACK;

apps/s_server.c:488:5: 
486.       OCSP_CERTID *id = NULL;
487.       STACK_OF(X509_EXTENSION) *exts;
488. >     int ret = SSL_TLSEXT_ERR_NOACK;
489.       int i;
490.   

apps/s_server.c:492:5: 
490.   
491.       /* Build up OCSP query from server certificate */
492. >     x = SSL_get_certificate(s);
493.       aia = X509_get1_ocsp(x);
494.       if (aia) {

ssl/ssl_lib.c:3466:1: start of procedure SSL_get_certificate()
  3464.   }
  3465.   
  3466. > X509 *SSL_get_certificate(const SSL *s)
  3467.   {
  3468.       if (s->cert != NULL)

ssl/ssl_lib.c:3468:9: Taking false branch
  3466.   X509 *SSL_get_certificate(const SSL *s)
  3467.   {
  3468.       if (s->cert != NULL)
                  ^
  3469.           return (s->cert->key->x509);
  3470.       else

ssl/ssl_lib.c:3471:9: 
  3469.           return (s->cert->key->x509);
  3470.       else
  3471. >         return (NULL);
  3472.   }
  3473.   

ssl/ssl_lib.c:3472:1: return from a call to SSL_get_certificate
  3470.       else
  3471.           return (NULL);
  3472. > }
  3473.   
  3474.   EVP_PKEY *SSL_get_privatekey(const SSL *s)

apps/s_server.c:493:5: 
491.       /* Build up OCSP query from server certificate */
492.       x = SSL_get_certificate(s);
493. >     aia = X509_get1_ocsp(x);
494.       if (aia) {
495.           if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0),
