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


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

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

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

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

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

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

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

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

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

ssl/ssl_lib.c:3703:1: start of procedure SSL_get_certificate()
  3701.   }
  3702.   
  3703. > X509 *SSL_get_certificate(const SSL *s)
  3704.   {
  3705.       if (s->cert != NULL)

ssl/ssl_lib.c:3705:9: Taking false branch
  3703.   X509 *SSL_get_certificate(const SSL *s)
  3704.   {
  3705.       if (s->cert != NULL)
                  ^
  3706.           return s->cert->key->x509;
  3707.       else

ssl/ssl_lib.c:3708:9: 
  3706.           return s->cert->key->x509;
  3707.       else
  3708. >         return NULL;
  3709.   }
  3710.   

ssl/ssl_lib.c:3709:1: return from a call to SSL_get_certificate
  3707.       else
  3708.           return NULL;
  3709. > }
  3710.   
  3711.   EVP_PKEY *SSL_get_privatekey(const SSL *s)

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