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


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

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

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

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

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

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

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

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

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

ssl/ssl_lib.c:3338:1: start of procedure SSL_get_certificate()
  3336.   }
  3337.   
  3338. > X509 *SSL_get_certificate(const SSL *s)
  3339.   {
  3340.       if (s->cert != NULL)

ssl/ssl_lib.c:3340:9: Taking false branch
  3338.   X509 *SSL_get_certificate(const SSL *s)
  3339.   {
  3340.       if (s->cert != NULL)
                  ^
  3341.           return (s->cert->key->x509);
  3342.       else

ssl/ssl_lib.c:3343:9: 
  3341.           return (s->cert->key->x509);
  3342.       else
  3343. >         return (NULL);
  3344.   }
  3345.   

ssl/ssl_lib.c:3344:1: return from a call to SSL_get_certificate
  3342.       else
  3343.           return (NULL);
  3344. > }
  3345.   
  3346.   EVP_PKEY *SSL_get_privatekey(const SSL *s)

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