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


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

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

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

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

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

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

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

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

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

ssl/ssl_lib.c:3814:1: start of procedure SSL_get_certificate()
  3812.   }
  3813.   
  3814. > X509 *SSL_get_certificate(const SSL *s)
  3815.   {
  3816.       if (s->cert != NULL)

ssl/ssl_lib.c:3816:9: Taking false branch
  3814.   X509 *SSL_get_certificate(const SSL *s)
  3815.   {
  3816.       if (s->cert != NULL)
                  ^
  3817.           return s->cert->key->x509;
  3818.       else

ssl/ssl_lib.c:3819:9: 
  3817.           return s->cert->key->x509;
  3818.       else
  3819. >         return NULL;
  3820.   }
  3821.   

ssl/ssl_lib.c:3820:1: return from a call to SSL_get_certificate
  3818.       else
  3819.           return NULL;
  3820. > }
  3821.   
  3822.   EVP_PKEY *SSL_get_privatekey(const SSL *s)

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