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


ssl/ssl_ciph.c:1864:1: start of procedure SSL_COMP_add_compression_method()
1862.   	}
1863.   
1864. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1865.   	{
1866.   	SSL_COMP *comp;

ssl/ssl_ciph.c:1868:13: Taking false branch
1866.   	SSL_COMP *comp;
1867.   
1868.           if (cm == NULL || cm->type == NID_undef)
                    ^
1869.                   return 1;
1870.   

ssl/ssl_ciph.c:1868:27: Taking false branch
1866.   	SSL_COMP *comp;
1867.   
1868.           if (cm == NULL || cm->type == NID_undef)
                                  ^
1869.                   return 1;
1870.   

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

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

ssl/ssl_ciph.c:1883:2: 
1881.   		}
1882.   
1883. > 	MemCheck_off();
1884.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1885.   	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:1884:2: 
1882.   
1883.   	MemCheck_off();
1884. > 	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1885.   	comp->id=id;
1886.   	comp->method=cm;

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

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

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

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

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

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

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

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

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

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

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

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

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

ssl/ssl_ciph.c:1885:2: 
1883.   	MemCheck_off();
1884.   	comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1885. > 	comp->id=id;
1886.   	comp->method=cm;
1887.   	load_builtin_compressions();
