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


apps/ca.c:3197:1: start of procedure unpack_revinfo()
3195.   	}
3196.   
3197. > int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3198.   	{
3199.   	char *tmp = NULL;

apps/ca.c:3199:2: 
3197.   int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3198.   	{
3199. > 	char *tmp = NULL;
3200.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3201.   	int reason_code = -1;

apps/ca.c:3200:2: 
3198.   	{
3199.   	char *tmp = NULL;
3200. > 	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3201.   	int reason_code = -1;
3202.   	int i, ret = 0;

apps/ca.c:3201:2: 
3199.   	char *tmp = NULL;
3200.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3201. > 	int reason_code = -1;
3202.   	int i, ret = 0;
3203.   	ASN1_OBJECT *hold = NULL;

apps/ca.c:3202:2: 
3200.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3201.   	int reason_code = -1;
3202. > 	int i, ret = 0;
3203.   	ASN1_OBJECT *hold = NULL;
3204.   	ASN1_GENERALIZEDTIME *comp_time = NULL;

apps/ca.c:3203:2: 
3201.   	int reason_code = -1;
3202.   	int i, ret = 0;
3203. > 	ASN1_OBJECT *hold = NULL;
3204.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
3205.   	tmp = BUF_strdup(str);

apps/ca.c:3204:2: 
3202.   	int i, ret = 0;
3203.   	ASN1_OBJECT *hold = NULL;
3204. > 	ASN1_GENERALIZEDTIME *comp_time = NULL;
3205.   	tmp = BUF_strdup(str);
3206.   

apps/ca.c:3205:2: 
3203.   	ASN1_OBJECT *hold = NULL;
3204.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
3205. > 	tmp = BUF_strdup(str);
3206.   
3207.   	p = strchr(tmp, ',');

crypto/buffer/buffer.c:128:1: start of procedure BUF_strdup()
  126.   	}
  127.   
  128. > char *BUF_strdup(const char *str)
  129.   	{
  130.   	char *ret;

crypto/buffer/buffer.c:133:6: Taking false branch
  131.   	int n;
  132.   
  133.   	if (str == NULL) return(NULL);
              ^
  134.   
  135.   	n=strlen(str);

crypto/buffer/buffer.c:135:2: 
  133.   	if (str == NULL) return(NULL);
  134.   
  135. > 	n=strlen(str);
  136.   	ret=OPENSSL_malloc(n+1);
  137.   	if (ret == NULL) 

crypto/buffer/buffer.c:136:2: 
  134.   
  135.   	n=strlen(str);
  136. > 	ret=OPENSSL_malloc(n+1);
  137.   	if (ret == NULL) 
  138.   		{

crypto/mem.c:282:1: start of procedure CRYPTO_malloc()
    280.   	}
    281.   
    282. > void *CRYPTO_malloc(int num, const char *file, int line)
    283.   	{
    284.   	void *ret = NULL;

crypto/mem.c:284:2: 
    282.   void *CRYPTO_malloc(int num, const char *file, int line)
    283.   	{
    284. > 	void *ret = NULL;
    285.   
    286.   	allow_customize = 0;

crypto/mem.c:286:2: 
    284.   	void *ret = NULL;
    285.   
    286. > 	allow_customize = 0;
    287.   	if (malloc_debug_func != NULL)
    288.   		{

crypto/mem.c:287:6: Taking false branch
    285.   
    286.   	allow_customize = 0;
    287.   	if (malloc_debug_func != NULL)
                ^
    288.   		{
    289.   		allow_customize_debug = 0;

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

crypto/mem.c:296:6: Taking false branch
    294.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    295.   #endif
    296.   	if (malloc_debug_func != NULL)
                ^
    297.   		malloc_debug_func(ret, num, file, line, 1);
    298.   

crypto/mem.c:299:2: 
    297.   		malloc_debug_func(ret, num, file, line, 1);
    298.   
    299. > 	return ret;
    300.   	}
    301.   

crypto/mem.c:300:2: return from a call to CRYPTO_malloc
    298.   
    299.   	return ret;
    300.   	}
            ^
    301.   
    302.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/buffer/buffer.c:137:6: Taking true branch
  135.   	n=strlen(str);
  136.   	ret=OPENSSL_malloc(n+1);
  137.   	if (ret == NULL) 
              ^
  138.   		{
  139.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:139:3: 
  137.   	if (ret == NULL) 
  138.   		{
  139. > 		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  140.   		return(NULL);
  141.   		}

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:321:1: start of procedure CRYPTO_free()
      319.   	}
      320.   
      321. > void CRYPTO_free(void *str)
      322.   	{
      323.   	if (free_debug_func != NULL)

crypto/mem.c:323:6: Taking true branch
      321.   void CRYPTO_free(void *str)
      322.   	{
      323.   	if (free_debug_func != NULL)
                  ^
      324.   		free_debug_func(str, 0);
      325.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:324:3: Skipping __function_pointer__(): unresolved function pointer
      322.   	{
      323.   	if (free_debug_func != NULL)
      324.   		free_debug_func(str, 0);
               ^
      325.   #ifdef LEVITTE_DEBUG_MEM
      326.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:328:2: Skipping __function_pointer__(): unresolved function pointer
      326.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
      327.   #endif
      328.   	free_func(str);
              ^
      329.   	if (free_debug_func != NULL)
      330.   		free_debug_func(NULL, 1);

crypto/mem.c:329:6: Taking true branch
      327.   #endif
      328.   	free_func(str);
      329.   	if (free_debug_func != NULL)
                  ^
      330.   		free_debug_func(NULL, 1);
      331.   	}

crypto/mem.c:330:3: Skipping __function_pointer__(): unresolved function pointer
      328.   	free_func(str);
      329.   	if (free_debug_func != NULL)
      330.   		free_debug_func(NULL, 1);
               ^
      331.   	}
      332.   

crypto/mem.c:329:2: 
      327.   #endif
      328.   	free_func(str);
      329. > 	if (free_debug_func != NULL)
      330.   		free_debug_func(NULL, 1);
      331.   	}

crypto/mem.c:331:2: return from a call to CRYPTO_free
      329.   	if (free_debug_func != NULL)
      330.   		free_debug_func(NULL, 1);
      331.   	}
              ^
      332.   
      333.   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:140:3: 
  138.   		{
  139.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  140. > 		return(NULL);
  141.   		}
  142.   	memcpy(ret,str,n+1);

crypto/buffer/buffer.c:144:2: return from a call to BUF_strdup
  142.   	memcpy(ret,str,n+1);
  143.   	return(ret);
  144.   	}
          ^
  145.   

apps/ca.c:3207:2: 
3205.   	tmp = BUF_strdup(str);
3206.   
3207. > 	p = strchr(tmp, ',');
3208.   
3209.   	rtime_str = tmp;
