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


ssl/ssl_ciph.c:1791:1: start of procedure SSL_COMP_add_compression_method()
1789.   	}
1790.   
1791. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1792.   	{
1793.   	SSL_COMP *comp;

ssl/ssl_ciph.c:1795:13: Taking false branch
1793.   	SSL_COMP *comp;
1794.   
1795.           if (cm == NULL || cm->type == NID_undef)
                    ^
1796.                   return 1;
1797.   

ssl/ssl_ciph.c:1795:27: Taking false branch
1793.   	SSL_COMP *comp;
1794.   
1795.           if (cm == NULL || cm->type == NID_undef)
                                  ^
1796.                   return 1;
1797.   

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

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

ssl/ssl_ciph.c:1810:2: 
1808.   		}
1809.   
1810. > 	MemCheck_off();
1811.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1812.   	comp->id=id;

crypto/mem_dbg.c:216:1: start of procedure CRYPTO_mem_ctrl()
  214.   	}
  215.   
  216. > int CRYPTO_mem_ctrl(int mode)
  217.   	{
  218.   	int ret=mh_mode;

crypto/mem_dbg.c:218:2: 
  216.   int CRYPTO_mem_ctrl(int mode)
  217.   	{
  218. > 	int ret=mh_mode;
  219.   
  220.   	CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);

crypto/mem_dbg.c:220:2: 
  218.   	int ret=mh_mode;
  219.   
  220. > 	CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
  221.   	switch (mode)
  222.   		{

crypto/lock.c:426:1: start of procedure CRYPTO_lock()
    424.   	}
    425.   
    426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
    427.   	{
    428.   #ifdef LOCK_DEBUG

crypto/lock.c:453:6: Taking false branch
    451.   		}
    452.   #endif
    453.   	if (type < 0)
                ^
    454.   		{
    455.   		if (dynlock_lock_callback != NULL)

crypto/lock.c:468:7: Taking true branch
    466.   		}
    467.   	else
    468.   		if (locking_callback != NULL)
                 ^
    469.   			locking_callback(mode,type,file,line);
    470.   	}

crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
    467.   	else
    468.   		if (locking_callback != NULL)
    469.   			locking_callback(mode,type,file,line);
              ^
    470.   	}
    471.   

crypto/lock.c:453:2: 
    451.   		}
    452.   #endif
    453. > 	if (type < 0)
    454.   		{
    455.   		if (dynlock_lock_callback != NULL)

crypto/lock.c:470:2: return from a call to CRYPTO_lock
    468.   		if (locking_callback != NULL)
    469.   			locking_callback(mode,type,file,line);
    470.   	}
            ^
    471.   
    472.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/mem_dbg.c:221:2: 
  219.   
  220.   	CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
  221. > 	switch (mode)
  222.   		{
  223.   	/* for applications (not to be called while multiple threads

crypto/mem_dbg.c:225:2: Switch condition is false. Skipping switch case
  223.   	/* for applications (not to be called while multiple threads
  224.   	 * use the library): */
  225.   	case CRYPTO_MEM_CHECK_ON: /* aka MemCheck_start() */
          ^
  226.   		mh_mode = CRYPTO_MEM_CHECK_ON|CRYPTO_MEM_CHECK_ENABLE;
  227.   		num_disable = 0;

crypto/mem_dbg.c:229:2: Switch condition is false. Skipping switch case
  227.   		num_disable = 0;
  228.   		break;
  229.   	case CRYPTO_MEM_CHECK_OFF: /* aka MemCheck_stop() */
          ^
  230.   		mh_mode = 0;
  231.   		num_disable = 0; /* should be true *before* MemCheck_stop is used,

crypto/mem_dbg.c:236:2: Switch condition is true. Entering switch case
  234.   
  235.   	/* switch off temporarily (for library-internal use): */
  236.   	case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
          ^
  237.   		if (mh_mode & CRYPTO_MEM_CHECK_ON)
  238.   			{

crypto/mem_dbg.c:237:7: Taking false branch
  235.   	/* switch off temporarily (for library-internal use): */
  236.   	case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
  237.   		if (mh_mode & CRYPTO_MEM_CHECK_ON)
               ^
  238.   			{
  239.   			CRYPTO_THREADID cur;

crypto/mem_dbg.c:282:2: 
  280.   		break;
  281.   		}
  282. > 	CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
  283.   	return(ret);
  284.   	}

crypto/lock.c:426:1: start of procedure CRYPTO_lock()
    424.   	}
    425.   
    426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
    427.   	{
    428.   #ifdef LOCK_DEBUG

crypto/lock.c:453:6: Taking false branch
    451.   		}
    452.   #endif
    453.   	if (type < 0)
                ^
    454.   		{
    455.   		if (dynlock_lock_callback != NULL)

crypto/lock.c:468:7: Taking true branch
    466.   		}
    467.   	else
    468.   		if (locking_callback != NULL)
                 ^
    469.   			locking_callback(mode,type,file,line);
    470.   	}

crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
    467.   	else
    468.   		if (locking_callback != NULL)
    469.   			locking_callback(mode,type,file,line);
              ^
    470.   	}
    471.   

crypto/lock.c:453:2: 
    451.   		}
    452.   #endif
    453. > 	if (type < 0)
    454.   		{
    455.   		if (dynlock_lock_callback != NULL)

crypto/lock.c:470:2: return from a call to CRYPTO_lock
    468.   		if (locking_callback != NULL)
    469.   			locking_callback(mode,type,file,line);
    470.   	}
            ^
    471.   
    472.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/mem_dbg.c:283:2: 
  281.   		}
  282.   	CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
  283. > 	return(ret);
  284.   	}
  285.   

crypto/mem_dbg.c:284:2: return from a call to CRYPTO_mem_ctrl
  282.   	CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
  283.   	return(ret);
  284.   	}
          ^
  285.   
  286.   int CRYPTO_is_mem_check_on(void)

ssl/ssl_ciph.c:1811:2: 
1809.   
1810.   	MemCheck_off();
1811. > 	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1812.   	comp->id=id;
1813.   	comp->method=cm;

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

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

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

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

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

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

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

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

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

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

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

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

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

ssl/ssl_ciph.c:1812:2: 
1810.   	MemCheck_off();
1811.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1812. > 	comp->id=id;
1813.   	comp->method=cm;
1814.   	load_builtin_compressions();
