ssl/ssl_ciph.c:1131: error: NULL_DEREFERENCE
  pointer `comp` last assigned on line 1130 could be null and is dereferenced at line 1131, column 2.
Showing all 18 steps of the trace


ssl/ssl_ciph.c:1121:1: start of procedure SSL_COMP_add_compression_method()
1119.   	}
1120.   
1121. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1122.   	{
1123.   	SSL_COMP *comp;

ssl/ssl_ciph.c:1126:13: Taking false branch
1124.   	STACK_OF(SSL_COMP) *sk;
1125.   
1126.           if (cm == NULL || cm->type == NID_undef)
                    ^
1127.                   return 1;
1128.   

ssl/ssl_ciph.c:1126:27: Taking false branch
1124.   	STACK_OF(SSL_COMP) *sk;
1125.   
1126.           if (cm == NULL || cm->type == NID_undef)
                                  ^
1127.                   return 1;
1128.   

ssl/ssl_ciph.c:1129:2: Skipping CRYPTO_mem_ctrl(): empty list of specs
1127.                   return 1;
1128.   
1129.   	MemCheck_off();
         ^
1130.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1131.   	comp->id=id;

ssl/ssl_ciph.c:1130:2: 
1128.   
1129.   	MemCheck_off();
1130. > 	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1131.   	comp->id=id;
1132.   	comp->method=cm;

crypto/mem.c:289:1: start of procedure CRYPTO_malloc()
  287.   	}
  288.   
  289. > void *CRYPTO_malloc(int num, const char *file, int line)
  290.   	{
  291.   	void *ret = NULL;

crypto/mem.c:291:2: 
  289.   void *CRYPTO_malloc(int num, const char *file, int line)
  290.   	{
  291. > 	void *ret = NULL;
  292.   	extern unsigned char cleanse_ctr;
  293.   

crypto/mem.c:294:2: 
  292.   	extern unsigned char cleanse_ctr;
  293.   
  294. > 	allow_customize = 0;
  295.   	if (malloc_debug_func != NULL)
  296.   		{

crypto/mem.c:295:6: Taking true branch
  293.   
  294.   	allow_customize = 0;
  295.   	if (malloc_debug_func != NULL)
              ^
  296.   		{
  297.   		allow_customize_debug = 0;

crypto/mem.c:297:3: 
  295.   	if (malloc_debug_func != NULL)
  296.   		{
  297. > 		allow_customize_debug = 0;
  298.   		malloc_debug_func(NULL, num, file, line, 0);
  299.   		}

crypto/mem.c:298:3: Skipping __function_pointer__(): unresolved function pointer
  296.   		{
  297.   		allow_customize_debug = 0;
  298.   		malloc_debug_func(NULL, num, file, line, 0);
           ^
  299.   		}
  300.   	ret = malloc_ex_func(num,file,line);

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

crypto/mem.c:304:6: Taking true branch
  302.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  303.   #endif
  304.   	if (malloc_debug_func != NULL)
              ^
  305.   		malloc_debug_func(ret, num, file, line, 1);
  306.   

crypto/mem.c:305:3: Skipping __function_pointer__(): unresolved function pointer
  303.   #endif
  304.   	if (malloc_debug_func != NULL)
  305.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  306.   
  307.           /* Create a dependency on the value of 'cleanse_ctr' so our memory

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

crypto/mem.c:313:2: 
  311.                   ((unsigned char *)ret)[0] = cleanse_ctr;
  312.   
  313. > 	return ret;
  314.   	}
  315.   

crypto/mem.c:314:2: return from a call to CRYPTO_malloc
  312.   
  313.   	return ret;
  314.   	}
          ^
  315.   
  316.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

ssl/ssl_ciph.c:1131:2: 
1129.   	MemCheck_off();
1130.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1131. > 	comp->id=id;
1132.   	comp->method=cm;
1133.   	if (ssl_comp_methods == NULL)

int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
	{
	SSL_COMP *comp;
	STACK_OF(SSL_COMP) *sk;
        if (cm == NULL || cm->type == NID_undef)
                return 1;
	MemCheck_off();
	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
	comp->id=id;
	comp->method=cm;
	if (ssl_comp_methods == NULL)
		sk=ssl_comp_methods=sk_SSL_COMP_new(sk_comp_cmp);
	else
		sk=ssl_comp_methods;
	if ((sk == NULL) || !sk_SSL_COMP_push(sk,comp))
		{
		MemCheck_on();
		SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,ERR_R_MALLOC_FAILURE);
		return(0);
		}
	else
		{
		MemCheck_on();
		return(1);
		}
	}
['int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)\n\t{\n\tSSL_COMP *comp;\n\tSTACK_OF(SSL_COMP) *sk;\n        if (cm == NULL || cm->type == NID_undef)\n                return 1;\n\tMemCheck_off();\n\tcomp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));\n\tcomp->id=id;\n\tcomp->method=cm;\n\tif (ssl_comp_methods == NULL)\n\t\tsk=ssl_comp_methods=sk_SSL_COMP_new(sk_comp_cmp);\n\telse\n\t\tsk=ssl_comp_methods;\n\tif ((sk == NULL) || !sk_SSL_COMP_push(sk,comp))\n\t\t{\n\t\tMemCheck_on();\n\t\tSSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,ERR_R_MALLOC_FAILURE);\n\t\treturn(0);\n\t\t}\n\telse\n\t\t{\n\t\tMemCheck_on();\n\t\treturn(1);\n\t\t}\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\textern unsigned char cleanse_ctr;\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        if(ret && (num > 2048))\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\treturn ret;\n\t}']