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


apps/ca.c:3183:1: start of procedure unpack_revinfo()
3181.   	}
3182.   
3183. > int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3184.   	{
3185.   	char *tmp = NULL;

apps/ca.c:3185:2: 
3183.   int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3184.   	{
3185. > 	char *tmp = NULL;
3186.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187.   	int reason_code = -1;

apps/ca.c:3186:2: 
3184.   	{
3185.   	char *tmp = NULL;
3186. > 	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187.   	int reason_code = -1;
3188.   	int i, ret = 0;

apps/ca.c:3187:2: 
3185.   	char *tmp = NULL;
3186.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187. > 	int reason_code = -1;
3188.   	int i, ret = 0;
3189.   	ASN1_OBJECT *hold = NULL;

apps/ca.c:3188:2: 
3186.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187.   	int reason_code = -1;
3188. > 	int i, ret = 0;
3189.   	ASN1_OBJECT *hold = NULL;
3190.   	ASN1_GENERALIZEDTIME *comp_time = NULL;

apps/ca.c:3189:2: 
3187.   	int reason_code = -1;
3188.   	int i, ret = 0;
3189. > 	ASN1_OBJECT *hold = NULL;
3190.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
3191.   	tmp = BUF_strdup(str);

apps/ca.c:3190:2: 
3188.   	int i, ret = 0;
3189.   	ASN1_OBJECT *hold = NULL;
3190. > 	ASN1_GENERALIZEDTIME *comp_time = NULL;
3191.   	tmp = BUF_strdup(str);
3192.   

apps/ca.c:3191:2: 
3189.   	ASN1_OBJECT *hold = NULL;
3190.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
3191. > 	tmp = BUF_strdup(str);
3192.   
3193.   	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:615:1: start of procedure ERR_put_error()
    613.   /********************************************************/
    614.   
    615. > void ERR_put_error(int lib, int func, int reason, const char *file,
    616.   	     int line)
    617.   	{

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

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

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

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

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

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

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

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

crypto/mem.c:318:1: start of procedure CRYPTO_free()
      316.   	}
      317.   
      318. > void CRYPTO_free(void *str)
      319.   	{
      320.   	if (free_debug_func != NULL)

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

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

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

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

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

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

crypto/mem.c:328:2: return from a call to CRYPTO_free
      326.   	if (free_debug_func != NULL)
      327.   		free_debug_func(NULL, 1);
      328.   	}
              ^
      329.   
      330.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

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

crypto/err/err.c:648:2: return from a call to ERR_put_error
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}
            ^
    649.   
    650.   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:3193:2: 
3191.   	tmp = BUF_strdup(str);
3192.   
3193. > 	p = strchr(tmp, ',');
3194.   
3195.   	rtime_str = tmp;
