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


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

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

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

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

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

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

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

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

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

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

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

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

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

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