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


apps/ca.c:2856:1: start of procedure make_revoked()
2854.    */
2855.   
2856. > int make_revoked(X509_REVOKED *rev, char *str)
2857.   	{
2858.   	char *tmp = NULL;

apps/ca.c:2858:2: 
2856.   int make_revoked(X509_REVOKED *rev, char *str)
2857.   	{
2858. > 	char *tmp = NULL;
2859.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2860.   	int reason_code = -1;

apps/ca.c:2859:2: 
2857.   	{
2858.   	char *tmp = NULL;
2859. > 	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2860.   	int reason_code = -1;
2861.   	int i, ret = 0;

apps/ca.c:2860:2: 
2858.   	char *tmp = NULL;
2859.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2860. > 	int reason_code = -1;
2861.   	int i, ret = 0;
2862.   	ASN1_OBJECT *hold = NULL;

apps/ca.c:2861:2: 
2859.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2860.   	int reason_code = -1;
2861. > 	int i, ret = 0;
2862.   	ASN1_OBJECT *hold = NULL;
2863.   	ASN1_GENERALIZEDTIME *comp_time = NULL;

apps/ca.c:2862:2: 
2860.   	int reason_code = -1;
2861.   	int i, ret = 0;
2862. > 	ASN1_OBJECT *hold = NULL;
2863.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
2864.   	ASN1_ENUMERATED *rtmp = NULL;

apps/ca.c:2863:2: 
2861.   	int i, ret = 0;
2862.   	ASN1_OBJECT *hold = NULL;
2863. > 	ASN1_GENERALIZEDTIME *comp_time = NULL;
2864.   	ASN1_ENUMERATED *rtmp = NULL;
2865.   	tmp = BUF_strdup(str);

apps/ca.c:2864:2: 
2862.   	ASN1_OBJECT *hold = NULL;
2863.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
2864. > 	ASN1_ENUMERATED *rtmp = NULL;
2865.   	tmp = BUF_strdup(str);
2866.   

apps/ca.c:2865:2: 
2863.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
2864.   	ASN1_ENUMERATED *rtmp = NULL;
2865. > 	tmp = BUF_strdup(str);
2866.   
2867.   	p = strchr(tmp, ',');

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

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

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

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

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:136:6: Taking true branch
  134.   	n=strlen(str);
  135.   	ret=OPENSSL_malloc(n+1);
  136.   	if (ret == NULL) 
              ^
  137.   		{
  138.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);

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

crypto/err/err.c:361:1: start of procedure ERR_put_error()
    359.   /********************************************************/
    360.   
    361. > void ERR_put_error(int lib, int func, int reason, const char *file,
    362.   	     int line)
    363.   	{

crypto/err/err.c:385:2: Skipping ERR_get_state(): empty list of specs
    383.   	}
    384.   #endif
    385.   	es=ERR_get_state();
            ^
    386.   
    387.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:387:2: 
    385.   	es=ERR_get_state();
    386.   
    387. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    388.   	if (es->top == es->bottom)
    389.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:388:6: Taking false branch
    386.   
    387.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    388.   	if (es->top == es->bottom)
                ^
    389.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    390.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:390:2: 
    388.   	if (es->top == es->bottom)
    389.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    390. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    391.   	es->err_file[es->top]=file;
    392.   	es->err_line[es->top]=line;

crypto/err/err.c:391:2: 
    389.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    390.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    391. > 	es->err_file[es->top]=file;
    392.   	es->err_line[es->top]=line;
    393.   	err_clear_data(es,es->top);

crypto/err/err.c:392:2: 
    390.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    391.   	es->err_file[es->top]=file;
    392. > 	es->err_line[es->top]=line;
    393.   	err_clear_data(es,es->top);
    394.   	}

crypto/err/err.c:393:2: Taking true branch
    391.   	es->err_file[es->top]=file;
    392.   	es->err_line[es->top]=line;
    393.   	err_clear_data(es,es->top);
            ^
    394.   	}
    395.   

crypto/err/err.c:393:2: Taking true branch
    391.   	es->err_file[es->top]=file;
    392.   	es->err_line[es->top]=line;
    393.   	err_clear_data(es,es->top);
            ^
    394.   	}
    395.   

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:393:2: 
    391.   	es->err_file[es->top]=file;
    392.   	es->err_line[es->top]=line;
    393. > 	err_clear_data(es,es->top);
    394.   	}
    395.   

crypto/err/err.c:394:2: return from a call to ERR_put_error
    392.   	es->err_line[es->top]=line;
    393.   	err_clear_data(es,es->top);
    394.   	}
            ^
    395.   
    396.   void ERR_clear_error(void)

crypto/buffer/buffer.c:139:3: 
  137.   		{
  138.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  139. > 		return(NULL);
  140.   		}
  141.   	memcpy(ret,str,n+1);

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

apps/ca.c:2867:2: 
2865.   	tmp = BUF_strdup(str);
2866.   
2867. > 	p = strchr(tmp, ',');
2868.   
2869.   	rtime_str = tmp;
