crypto/ocsp/ocsp_ht.c:129: error: NULL_DEREFERENCE
  pointer `rctx` last assigned on line 128 could be null and is dereferenced at line 129, column 2.
Showing all 17 steps of the trace


crypto/ocsp/ocsp_ht.c:120:1: start of procedure OCSP_sendreq_new()
118.   	}
119.   
120. > OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,
121.   								int maxline)
122.   	{

crypto/ocsp/ocsp_ht.c:123:2: 
121.   								int maxline)
122.   	{
123. > 	static const char post_hdr[] = "POST %s HTTP/1.0\r\n"
124.   	"Content-Type: application/ocsp-request\r\n"
125.   	"Content-Length: %d\r\n\r\n";

crypto/ocsp/ocsp_ht.c:128:2: 
126.   
127.   	OCSP_REQ_CTX *rctx;
128. > 	rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
129.   	rctx->state = OHS_FIRSTLINE;
130.   	rctx->mem = BIO_new(BIO_s_mem());

crypto/mem.c:294:1: start of procedure CRYPTO_malloc()
  292.   	}
  293.   
  294. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  295.   	{
  296.   	void *ret = NULL;

crypto/mem.c:296:2: 
  294.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  295.   	{
  296. > 	void *ret = NULL;
  297.   
  298.   	if (num <= 0) return NULL;

crypto/mem.c:298:6: Taking false branch
  296.   	void *ret = NULL;
  297.   
  298.   	if (num <= 0) return NULL;
              ^
  299.   
  300.   	allow_customize = 0;

crypto/mem.c:300:2: 
  298.   	if (num <= 0) return NULL;
  299.   
  300. > 	allow_customize = 0;
  301.   	if (malloc_debug_func != NULL)
  302.   		{

crypto/mem.c:301:6: Taking true branch
  299.   
  300.   	allow_customize = 0;
  301.   	if (malloc_debug_func != NULL)
              ^
  302.   		{
  303.   		allow_customize_debug = 0;

crypto/mem.c:303:3: 
  301.   	if (malloc_debug_func != NULL)
  302.   		{
  303. > 		allow_customize_debug = 0;
  304.   		malloc_debug_func(NULL, num, file, line, 0);
  305.   		}

crypto/mem.c:304:3: Skipping __function_pointer__(): unresolved function pointer
  302.   		{
  303.   		allow_customize_debug = 0;
  304.   		malloc_debug_func(NULL, num, file, line, 0);
           ^
  305.   		}
  306.   	ret = malloc_ex_func(num,file,line);

crypto/mem.c:306:2: Skipping __function_pointer__(): unresolved function pointer
  304.   		malloc_debug_func(NULL, num, file, line, 0);
  305.   		}
  306.   	ret = malloc_ex_func(num,file,line);
          ^
  307.   #ifdef LEVITTE_DEBUG_MEM
  308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:310:6: Taking true branch
  308.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  309.   #endif
  310.   	if (malloc_debug_func != NULL)
              ^
  311.   		malloc_debug_func(ret, num, file, line, 1);
  312.   

crypto/mem.c:311:3: Skipping __function_pointer__(): unresolved function pointer
  309.   #endif
  310.   	if (malloc_debug_func != NULL)
  311.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  312.   
  313.   #ifndef OPENSSL_CPUID_OBJ

crypto/mem.c:317:12: Taking false branch
  315.            * sanitisation function can't be optimised out. NB: We only do
  316.            * this for >2Kb so the overhead doesn't bother us. */
  317.           if(ret && (num > 2048))
                    ^
  318.   	{	extern unsigned char cleanse_ctr;
  319.                   ((unsigned char *)ret)[0] = cleanse_ctr;

crypto/mem.c:323:2: 
  321.   #endif
  322.   
  323. > 	return ret;
  324.   	}
  325.   char *CRYPTO_strdup(const char *str, const char *file, int line)

crypto/mem.c:324:2: return from a call to CRYPTO_malloc
  322.   
  323.   	return ret;
  324.   	}
          ^
  325.   char *CRYPTO_strdup(const char *str, const char *file, int line)
  326.   	{

crypto/ocsp/ocsp_ht.c:129:2: 
127.   	OCSP_REQ_CTX *rctx;
128.   	rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
129. > 	rctx->state = OHS_FIRSTLINE;
130.   	rctx->mem = BIO_new(BIO_s_mem());
131.   	rctx->io = io;

OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,
								int maxline)
	{
	static const char post_hdr[] = "POST %s HTTP/1.0\r\n"
	"Content-Type: application/ocsp-request\r\n"
	"Content-Length: %d\r\n\r\n";
	OCSP_REQ_CTX *rctx;
	rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
	rctx->state = OHS_FIRSTLINE;
	rctx->mem = BIO_new(BIO_s_mem());
	rctx->io = io;
	if (maxline > 0)
		rctx->iobuflen = maxline;
	else
		rctx->iobuflen = OCSP_MAX_LINE_LEN;
	rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
	if (!path)
		path = "/";
        if (BIO_printf(rctx->mem, post_hdr, path,
				i2d_OCSP_REQUEST(req, NULL)) <= 0)
		{
		rctx->state = OHS_ERROR;
		return 0;
		}
        if (i2d_OCSP_REQUEST_bio(rctx->mem, req) <= 0)
		{
		rctx->state = OHS_ERROR;
		return 0;
		}
	rctx->state = OHS_ASN1_WRITE;
	rctx->asn1_len = BIO_get_mem_data(rctx->mem, NULL);
	return rctx;
	}
['OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,\n\t\t\t\t\t\t\t\tint maxline)\n\t{\n\tstatic const char post_hdr[] = "POST %s HTTP/1.0\\r\\n"\n\t"Content-Type: application/ocsp-request\\r\\n"\n\t"Content-Length: %d\\r\\n\\r\\n";\n\tOCSP_REQ_CTX *rctx;\n\trctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));\n\trctx->state = OHS_FIRSTLINE;\n\trctx->mem = BIO_new(BIO_s_mem());\n\trctx->io = io;\n\tif (maxline > 0)\n\t\trctx->iobuflen = maxline;\n\telse\n\t\trctx->iobuflen = OCSP_MAX_LINE_LEN;\n\trctx->iobuf = OPENSSL_malloc(rctx->iobuflen);\n\tif (!path)\n\t\tpath = "/";\n        if (BIO_printf(rctx->mem, post_hdr, path,\n\t\t\t\ti2d_OCSP_REQUEST(req, NULL)) <= 0)\n\t\t{\n\t\trctx->state = OHS_ERROR;\n\t\treturn 0;\n\t\t}\n        if (i2d_OCSP_REQUEST_bio(rctx->mem, req) <= 0)\n\t\t{\n\t\trctx->state = OHS_ERROR;\n\t\treturn 0;\n\t\t}\n\trctx->state = OHS_ASN1_WRITE;\n\trctx->asn1_len = BIO_get_mem_data(rctx->mem, NULL);\n\treturn rctx;\n\t}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\tif (num <= 0) return NULL;\n\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tallow_customize_debug = 0;\n\t\tmalloc_debug_func(NULL, num, file, line, 0);\n\t\t}\n\tret = malloc_ex_func(num,file,line);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\\n", ret, num);\n#endif\n\tif (malloc_debug_func != NULL)\n\t\tmalloc_debug_func(ret, num, file, line, 1);\n#ifndef OPENSSL_CPUID_OBJ\n        if(ret && (num > 2048))\n\t{\textern unsigned char cleanse_ctr;\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\t}\n#endif\n\treturn ret;\n\t}']