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


ssl/ssl_ciph.c:1624:1: start of procedure SSL_COMP_add_compression_method()
1622.   	}
1623.   
1624. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1625.   	{
1626.   	SSL_COMP *comp;

ssl/ssl_ciph.c:1628:13: Taking false branch
1626.   	SSL_COMP *comp;
1627.   
1628.           if (cm == NULL || cm->type == NID_undef)
                    ^
1629.                   return 1;
1630.   

ssl/ssl_ciph.c:1628:27: Taking false branch
1626.   	SSL_COMP *comp;
1627.   
1628.           if (cm == NULL || cm->type == NID_undef)
                                  ^
1629.                   return 1;
1630.   

ssl/ssl_ciph.c:1637:6: Taking false branch
1635.   	   64 to 192:  external party methods assigned by IANA
1636.   	   193 to 255: reserved for private use */
1637.   	if (id < 193 || id > 255)
             ^
1638.   		{
1639.   		SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);

ssl/ssl_ciph.c:1637:18: Taking false branch
1635.   	   64 to 192:  external party methods assigned by IANA
1636.   	   193 to 255: reserved for private use */
1637.   	if (id < 193 || id > 255)
                         ^
1638.   		{
1639.   		SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);

ssl/ssl_ciph.c:1643:2: Skipping CRYPTO_mem_ctrl(): empty list of specs
1641.   		}
1642.   
1643.   	MemCheck_off();
         ^
1644.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1645.   	comp->id=id;

ssl/ssl_ciph.c:1644:2: 
1642.   
1643.   	MemCheck_off();
1644. > 	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1645.   	comp->id=id;
1646.   	comp->method=cm;

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

crypto/mem.c:296:2: 
  294.   void *CRYPTO_malloc(int 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.   

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

ssl/ssl_ciph.c:1645:2: 
1643.   	MemCheck_off();
1644.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1645. > 	comp->id=id;
1646.   	comp->method=cm;
1647.   	load_builtin_compressions();
