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


apps/s_server.c:508:1: start of procedure get_ocsp_resp_from_responder()
506.    * them until they were considered "expired".
507.    */
508. > static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx,
509.                                           OCSP_RESPONSE **resp)
510.   {

apps/s_server.c:511:5: 
509.                                           OCSP_RESPONSE **resp)
510.   {
511. >     char *host = NULL, *port = NULL, *path = NULL;
512.       int use_ssl;
513.       STACK_OF(OPENSSL_STRING) *aia = NULL;

apps/s_server.c:513:5: 
511.       char *host = NULL, *port = NULL, *path = NULL;
512.       int use_ssl;
513. >     STACK_OF(OPENSSL_STRING) *aia = NULL;
514.       X509 *x = NULL;
515.       X509_STORE_CTX *inctx = NULL;

apps/s_server.c:514:5: 
512.       int use_ssl;
513.       STACK_OF(OPENSSL_STRING) *aia = NULL;
514. >     X509 *x = NULL;
515.       X509_STORE_CTX *inctx = NULL;
516.       X509_OBJECT *obj;

apps/s_server.c:515:5: 
513.       STACK_OF(OPENSSL_STRING) *aia = NULL;
514.       X509 *x = NULL;
515. >     X509_STORE_CTX *inctx = NULL;
516.       X509_OBJECT *obj;
517.       OCSP_REQUEST *req = NULL;

apps/s_server.c:517:5: 
515.       X509_STORE_CTX *inctx = NULL;
516.       X509_OBJECT *obj;
517. >     OCSP_REQUEST *req = NULL;
518.       OCSP_CERTID *id = NULL;
519.       STACK_OF(X509_EXTENSION) *exts;

apps/s_server.c:518:5: 
516.       X509_OBJECT *obj;
517.       OCSP_REQUEST *req = NULL;
518. >     OCSP_CERTID *id = NULL;
519.       STACK_OF(X509_EXTENSION) *exts;
520.       int ret = SSL_TLSEXT_ERR_NOACK;

apps/s_server.c:520:5: 
518.       OCSP_CERTID *id = NULL;
519.       STACK_OF(X509_EXTENSION) *exts;
520. >     int ret = SSL_TLSEXT_ERR_NOACK;
521.       int i;
522.   

apps/s_server.c:524:5: 
522.   
523.       /* Build up OCSP query from server certificate */
524. >     x = SSL_get_certificate(s);
525.       aia = X509_get1_ocsp(x);
526.       if (aia != NULL) {

ssl/ssl_lib.c:3851:1: start of procedure SSL_get_certificate()
  3849.   }
  3850.   
  3851. > X509 *SSL_get_certificate(const SSL *s)
  3852.   {
  3853.       if (s->cert != NULL)

ssl/ssl_lib.c:3853:9: Taking false branch
  3851.   X509 *SSL_get_certificate(const SSL *s)
  3852.   {
  3853.       if (s->cert != NULL)
                  ^
  3854.           return s->cert->key->x509;
  3855.       else

ssl/ssl_lib.c:3856:9: 
  3854.           return s->cert->key->x509;
  3855.       else
  3856. >         return NULL;
  3857.   }
  3858.   

ssl/ssl_lib.c:3857:1: return from a call to SSL_get_certificate
  3855.       else
  3856.           return NULL;
  3857. > }
  3858.   
  3859.   EVP_PKEY *SSL_get_privatekey(const SSL *s)

apps/s_server.c:525:5: 
523.       /* Build up OCSP query from server certificate */
524.       x = SSL_get_certificate(s);
525. >     aia = X509_get1_ocsp(x);
526.       if (aia != NULL) {
527.           if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0),
