apps/ca.c:3244: error: NULL_DEREFERENCE
  pointer `tmp` last assigned on line 3242 could be null and is dereferenced by call to `strchr()` at line 3244, column 6.
Showing all 48 steps of the trace


apps/ca.c:3234:1: start of procedure unpack_revinfo()
3232.   	}
3233.   
3234. > int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3235.   	{
3236.   	char *tmp = NULL;

apps/ca.c:3236:2: 
3234.   int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3235.   	{
3236. > 	char *tmp = NULL;
3237.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3238.   	int reason_code = -1;

apps/ca.c:3237:2: 
3235.   	{
3236.   	char *tmp = NULL;
3237. > 	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3238.   	int reason_code = -1;
3239.   	int i, ret = 0;

apps/ca.c:3238:2: 
3236.   	char *tmp = NULL;
3237.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3238. > 	int reason_code = -1;
3239.   	int i, ret = 0;
3240.   	ASN1_OBJECT *hold = NULL;

apps/ca.c:3239:2: 
3237.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3238.   	int reason_code = -1;
3239. > 	int i, ret = 0;
3240.   	ASN1_OBJECT *hold = NULL;
3241.   	ASN1_GENERALIZEDTIME *comp_time = NULL;

apps/ca.c:3240:2: 
3238.   	int reason_code = -1;
3239.   	int i, ret = 0;
3240. > 	ASN1_OBJECT *hold = NULL;
3241.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
3242.   	tmp = BUF_strdup(str);

apps/ca.c:3241:2: 
3239.   	int i, ret = 0;
3240.   	ASN1_OBJECT *hold = NULL;
3241. > 	ASN1_GENERALIZEDTIME *comp_time = NULL;
3242.   	tmp = BUF_strdup(str);
3243.   

apps/ca.c:3242:2: 
3240.   	ASN1_OBJECT *hold = NULL;
3241.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
3242. > 	tmp = BUF_strdup(str);
3243.   
3244.   	p = strchr(tmp, ',');

crypto/buffer/buffer.c:165:1: start of procedure BUF_strdup()
  163.   	}
  164.   
  165. > char *BUF_strdup(const char *str)
  166.   	{
  167.   	char *ret;

crypto/buffer/buffer.c:170:6: Taking false branch
  168.   	int n;
  169.   
  170.   	if (str == NULL) return(NULL);
              ^
  171.   
  172.   	n=strlen(str);

crypto/buffer/buffer.c:172:2: 
  170.   	if (str == NULL) return(NULL);
  171.   
  172. > 	n=strlen(str);
  173.   	ret=OPENSSL_malloc(n+1);
  174.   	if (ret == NULL) 

crypto/buffer/buffer.c:173:2: 
  171.   
  172.   	n=strlen(str);
  173. > 	ret=OPENSSL_malloc(n+1);
  174.   	if (ret == NULL) 
  175.   		{

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)

crypto/buffer/buffer.c:174:6: Taking true branch
  172.   	n=strlen(str);
  173.   	ret=OPENSSL_malloc(n+1);
  174.   	if (ret == NULL) 
              ^
  175.   		{
  176.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:176:3: 
  174.   	if (ret == NULL) 
  175.   		{
  176. > 		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  177.   		return(NULL);
  178.   		}

crypto/err/err.c:617:1: start of procedure ERR_put_error()
    615.   /********************************************************/
    616.   
    617. > void ERR_put_error(int lib, int func, int reason, const char *file,
    618.   	     int line)
    619.   	{

crypto/err/err.c:641:2: Skipping ERR_get_state(): empty list of specs
    639.   	}
    640.   #endif
    641.   	es=ERR_get_state();
            ^
    642.   
    643.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:643:2: 
    641.   	es=ERR_get_state();
    642.   
    643. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    644.   	if (es->top == es->bottom)
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:644:6: Taking false branch
    642.   
    643.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    644.   	if (es->top == es->bottom)
                ^
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    646.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:646:2: 
    644.   	if (es->top == es->bottom)
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    646. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;

crypto/err/err.c:647:2: 
    645.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    646.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    647. > 	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);

crypto/err/err.c:648:2: 
    646.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    647.   	es->err_file[es->top]=file;
    648. > 	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
    650.   	}

crypto/err/err.c:649:2: Taking true branch
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
            ^
    650.   	}
    651.   

crypto/err/err.c:649:2: Taking true branch
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
            ^
    650.   	}
    651.   

crypto/mem.c:357:1: start of procedure CRYPTO_free()
      355.   	}
      356.   
      357. > void CRYPTO_free(void *str)
      358.   	{
      359.   	if (free_debug_func != NULL)

crypto/mem.c:359:6: Taking true branch
      357.   void CRYPTO_free(void *str)
      358.   	{
      359.   	if (free_debug_func != NULL)
                  ^
      360.   		free_debug_func(str, 0);
      361.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:360:3: Skipping __function_pointer__(): unresolved function pointer
      358.   	{
      359.   	if (free_debug_func != NULL)
      360.   		free_debug_func(str, 0);
               ^
      361.   #ifdef LEVITTE_DEBUG_MEM
      362.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:364:2: Skipping __function_pointer__(): unresolved function pointer
      362.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      363.   #endif
      364.   	free_func(str);
              ^
      365.   	if (free_debug_func != NULL)
      366.   		free_debug_func(NULL, 1);

crypto/mem.c:365:6: Taking true branch
      363.   #endif
      364.   	free_func(str);
      365.   	if (free_debug_func != NULL)
                  ^
      366.   		free_debug_func(NULL, 1);
      367.   	}

crypto/mem.c:366:3: Skipping __function_pointer__(): unresolved function pointer
      364.   	free_func(str);
      365.   	if (free_debug_func != NULL)
      366.   		free_debug_func(NULL, 1);
               ^
      367.   	}
      368.   

crypto/mem.c:365:2: 
      363.   #endif
      364.   	free_func(str);
      365. > 	if (free_debug_func != NULL)
      366.   		free_debug_func(NULL, 1);
      367.   	}

crypto/mem.c:367:2: return from a call to CRYPTO_free
      365.   	if (free_debug_func != NULL)
      366.   		free_debug_func(NULL, 1);
      367.   	}
              ^
      368.   
      369.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/err/err.c:649:2: 
    647.   	es->err_file[es->top]=file;
    648.   	es->err_line[es->top]=line;
    649. > 	err_clear_data(es,es->top);
    650.   	}
    651.   

crypto/err/err.c:650:2: return from a call to ERR_put_error
    648.   	es->err_line[es->top]=line;
    649.   	err_clear_data(es,es->top);
    650.   	}
            ^
    651.   
    652.   void ERR_clear_error(void)

crypto/buffer/buffer.c:177:3: 
  175.   		{
  176.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  177. > 		return(NULL);
  178.   		}
  179.   	memcpy(ret,str,n+1);

crypto/buffer/buffer.c:181:2: return from a call to BUF_strdup
  179.   	memcpy(ret,str,n+1);
  180.   	return(ret);
  181.   	}
          ^
  182.   
  183.   size_t BUF_strlcpy(char *dst, const char *src, size_t size)

apps/ca.c:3244:2: 
3242.   	tmp = BUF_strdup(str);
3243.   
3244. > 	p = strchr(tmp, ',');
3245.   
3246.   	rtime_str = tmp;
