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


apps/ca.c:2931:1: start of procedure unpack_revinfo()
2929.   	}
2930.   
2931. > int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, const char *str)
2932.   	{
2933.   	char *tmp = NULL;

apps/ca.c:2933:2: 
2931.   int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, const char *str)
2932.   	{
2933. > 	char *tmp = NULL;
2934.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2935.   	int reason_code = -1;

apps/ca.c:2934:2: 
2932.   	{
2933.   	char *tmp = NULL;
2934. > 	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2935.   	int reason_code = -1;
2936.   	int ret = 0;

apps/ca.c:2935:2: 
2933.   	char *tmp = NULL;
2934.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2935. > 	int reason_code = -1;
2936.   	int ret = 0;
2937.   	unsigned int i;

apps/ca.c:2936:2: 
2934.   	char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
2935.   	int reason_code = -1;
2936. > 	int ret = 0;
2937.   	unsigned int i;
2938.   	ASN1_OBJECT *hold = NULL;

apps/ca.c:2938:2: 
2936.   	int ret = 0;
2937.   	unsigned int i;
2938. > 	ASN1_OBJECT *hold = NULL;
2939.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
2940.   	tmp = BUF_strdup(str);

apps/ca.c:2939:2: 
2937.   	unsigned int i;
2938.   	ASN1_OBJECT *hold = NULL;
2939. > 	ASN1_GENERALIZEDTIME *comp_time = NULL;
2940.   	tmp = BUF_strdup(str);
2941.   

apps/ca.c:2940:2: 
2938.   	ASN1_OBJECT *hold = NULL;
2939.   	ASN1_GENERALIZEDTIME *comp_time = NULL;
2940. > 	tmp = BUF_strdup(str);
2941.   
2942.   	p = strchr(tmp, ',');

crypto/buffer/buf_str.c:75:1: start of procedure BUF_strdup()
  73.   	}
  74.   
  75. > char *BUF_strdup(const char *str)
  76.   	{
  77.   	if (str == NULL) return(NULL);

crypto/buffer/buf_str.c:77:6: Taking true branch
  75.   char *BUF_strdup(const char *str)
  76.   	{
  77.   	if (str == NULL) return(NULL);
             ^
  78.   	return BUF_strndup(str, strlen(str));
  79.   	}

crypto/buffer/buf_str.c:77:19: 
  75.   char *BUF_strdup(const char *str)
  76.   	{
  77. > 	if (str == NULL) return(NULL);
  78.   	return BUF_strndup(str, strlen(str));
  79.   	}

crypto/buffer/buf_str.c:79:2: return from a call to BUF_strdup
  77.   	if (str == NULL) return(NULL);
  78.   	return BUF_strndup(str, strlen(str));
  79.   	}
         ^
  80.   
  81.   char *BUF_strndup(const char *str, size_t siz)

apps/ca.c:2942:2: 
2940.   	tmp = BUF_strdup(str);
2941.   
2942. > 	p = strchr(tmp, ',');
2943.   
2944.   	rtime_str = tmp;
