apps/ca.c:2939: error: NULL_DEREFERENCE
  pointer `revtm` last assigned on line 2937 could be null and is dereferenced at line 2939, column 6.
Showing all 41 steps of the trace


apps/ca.c:2875:1: start of procedure make_revocation_str()
2873.    */
2874.   
2875. > char *make_revocation_str(int rev_type, char *rev_arg)
2876.   	{
2877.   	char *reason = NULL, *other = NULL, *str;

apps/ca.c:2877:2: 
2875.   char *make_revocation_str(int rev_type, char *rev_arg)
2876.   	{
2877. > 	char *reason = NULL, *other = NULL, *str;
2878.   	ASN1_OBJECT *otmp;
2879.   	ASN1_UTCTIME *revtm = NULL;

apps/ca.c:2879:2: 
2877.   	char *reason = NULL, *other = NULL, *str;
2878.   	ASN1_OBJECT *otmp;
2879. > 	ASN1_UTCTIME *revtm = NULL;
2880.   	int i;
2881.   	switch (rev_type)

apps/ca.c:2881:2: 
2879.   	ASN1_UTCTIME *revtm = NULL;
2880.   	int i;
2881. > 	switch (rev_type)
2882.   		{
2883.   	case REV_NONE:

apps/ca.c:2883:2: Switch condition is false. Skipping switch case
2881.   	switch (rev_type)
2882.   		{
2883.   	case REV_NONE:
         ^
2884.   		break;
2885.   

apps/ca.c:2886:2: Switch condition is false. Skipping switch case
2884.   		break;
2885.   
2886.   	case REV_CRL_REASON:
         ^
2887.   		for (i = 0; i < 8; i++)
2888.   			{

apps/ca.c:2902:2: Switch condition is false. Skipping switch case
2900.   		break;
2901.   
2902.   	case REV_HOLD:
         ^
2903.   		/* Argument is an OID */
2904.   

apps/ca.c:2918:2: Switch condition is true. Entering switch case
2916.   		break;
2917.   		
2918.   	case REV_KEY_COMPROMISE:
         ^
2919.   	case REV_CA_COMPROMISE:
2920.   

apps/ca.c:2922:8: 
2920.   
2921.   		/* Argument is the key compromise time  */
2922. > 		if (!ASN1_GENERALIZEDTIME_set_string(NULL, rev_arg))
2923.   			{	
2924.   			BIO_printf(bio_err, "Invalid time format %s. Need YYYYMMDDHHMMSSZ\n", rev_arg);

crypto/asn1/a_gentm.c:184:1: start of procedure ASN1_GENERALIZEDTIME_set_string()
  182.   	}
  183.   
  184. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str)
  185.   	{
  186.   	ASN1_GENERALIZEDTIME t;

crypto/asn1/a_gentm.c:188:2: 
  186.   	ASN1_GENERALIZEDTIME t;
  187.   
  188. > 	t.type=V_ASN1_GENERALIZEDTIME;
  189.   	t.length=strlen(str);
  190.   	t.data=(unsigned char *)str;

crypto/asn1/a_gentm.c:189:2: 
  187.   
  188.   	t.type=V_ASN1_GENERALIZEDTIME;
  189. > 	t.length=strlen(str);
  190.   	t.data=(unsigned char *)str;
  191.   	if (ASN1_GENERALIZEDTIME_check(&t))

crypto/asn1/a_gentm.c:190:2: 
  188.   	t.type=V_ASN1_GENERALIZEDTIME;
  189.   	t.length=strlen(str);
  190. > 	t.data=(unsigned char *)str;
  191.   	if (ASN1_GENERALIZEDTIME_check(&t))
  192.   		{

crypto/asn1/a_gentm.c:191:6: Taking true branch
  189.   	t.length=strlen(str);
  190.   	t.data=(unsigned char *)str;
  191.   	if (ASN1_GENERALIZEDTIME_check(&t))
              ^
  192.   		{
  193.   		if (s != NULL)

crypto/asn1/a_gentm.c:193:7: Taking false branch
  191.   	if (ASN1_GENERALIZEDTIME_check(&t))
  192.   		{
  193.   		if (s != NULL)
               ^
  194.   			{
  195.   			ASN1_STRING_set((ASN1_STRING *)s,

crypto/asn1/a_gentm.c:199:3: 
  197.   			s->type=V_ASN1_GENERALIZEDTIME;
  198.   			}
  199. > 		return(1);
  200.   		}
  201.   	else

crypto/asn1/a_gentm.c:203:2: return from a call to ASN1_GENERALIZEDTIME_set_string
  201.   	else
  202.   		return(0);
  203.   	}
          ^
  204.   
  205.   ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,

apps/ca.c:2922:8: Taking false branch
2920.   
2921.   		/* Argument is the key compromise time  */
2922.   		if (!ASN1_GENERALIZEDTIME_set_string(NULL, rev_arg))
               ^
2923.   			{	
2924.   			BIO_printf(bio_err, "Invalid time format %s. Need YYYYMMDDHHMMSSZ\n", rev_arg);

apps/ca.c:2927:3: 
2925.   			return NULL;
2926.   			}
2927. > 		other = rev_arg;
2928.   		if (rev_type == REV_KEY_COMPROMISE)
2929.   			reason = "keyTime";

apps/ca.c:2928:7: Taking true branch
2926.   			}
2927.   		other = rev_arg;
2928.   		if (rev_type == REV_KEY_COMPROMISE)
              ^
2929.   			reason = "keyTime";
2930.   		else 

apps/ca.c:2929:4: 
2927.   		other = rev_arg;
2928.   		if (rev_type == REV_KEY_COMPROMISE)
2929. > 			reason = "keyTime";
2930.   		else 
2931.   			reason = "CAkeyTime";

apps/ca.c:2937:2: 
2935.   		}
2936.   
2937. > 	revtm = X509_gmtime_adj(NULL, 0);
2938.   
2939.   	i = revtm->length + 1;

crypto/x509/x509_vfy.c:832:1: start of procedure X509_gmtime_adj()
  830.   	}
  831.   
  832. > ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj)
  833.   {
  834.   	return X509_time_adj(s, adj, NULL);

crypto/x509/x509_vfy.c:834:2: 
  832.   ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj)
  833.   {
  834. > 	return X509_time_adj(s, adj, NULL);
  835.   }
  836.   

crypto/x509/x509_vfy.c:837:1: start of procedure X509_time_adj()
    835.   }
    836.   
    837. > ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm)
    838.   	{
    839.   	time_t t;

crypto/x509/x509_vfy.c:840:2: 
    838.   	{
    839.   	time_t t;
    840. > 	int type = -1;
    841.   
    842.   	if (in_tm) t = *in_tm;

crypto/x509/x509_vfy.c:842:6: Taking false branch
    840.   	int type = -1;
    841.   
    842.   	if (in_tm) t = *in_tm;
                ^
    843.   	else time(&t);
    844.   

crypto/x509/x509_vfy.c:843:7: 
    841.   
    842.   	if (in_tm) t = *in_tm;
    843. > 	else time(&t);
    844.   
    845.   	t+=adj;

crypto/x509/x509_vfy.c:845:2: 
    843.   	else time(&t);
    844.   
    845. > 	t+=adj;
    846.   	if (s) type = s->type;
    847.   	if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);

crypto/x509/x509_vfy.c:846:6: Taking false branch
    844.   
    845.   	t+=adj;
    846.   	if (s) type = s->type;
                ^
    847.   	if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);
    848.   	if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t);

crypto/x509/x509_vfy.c:847:6: Taking false branch
    845.   	t+=adj;
    846.   	if (s) type = s->type;
    847.   	if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);
                ^
    848.   	if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t);
    849.   	return ASN1_TIME_set(s, t);

crypto/x509/x509_vfy.c:848:6: Taking false branch
    846.   	if (s) type = s->type;
    847.   	if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);
    848.   	if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t);
                ^
    849.   	return ASN1_TIME_set(s, t);
    850.   	}

crypto/x509/x509_vfy.c:849:2: 
    847.   	if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);
    848.   	if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t);
    849. > 	return ASN1_TIME_set(s, t);
    850.   	}
    851.   

crypto/asn1/a_time.c:101:1: start of procedure ASN1_TIME_set()
      99.   
      100.   
      101. > ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
      102.   	{
      103.   	struct tm *ts;

crypto/asn1/a_time.c:106:2: Skipping OPENSSL_gmtime(): empty list of specs
      104.   	struct tm data;
      105.   
      106.   	ts=OPENSSL_gmtime(&t,&data);
              ^
      107.   	if (ts == NULL)
      108.   		return NULL;

crypto/asn1/a_time.c:107:6: Taking true branch
      105.   
      106.   	ts=OPENSSL_gmtime(&t,&data);
      107.   	if (ts == NULL)
                  ^
      108.   		return NULL;
      109.   	if((ts->tm_year >= 50) && (ts->tm_year < 150))

crypto/asn1/a_time.c:108:3: 
      106.   	ts=OPENSSL_gmtime(&t,&data);
      107.   	if (ts == NULL)
      108. > 		return NULL;
      109.   	if((ts->tm_year >= 50) && (ts->tm_year < 150))
      110.   					return ASN1_UTCTIME_set(s, t);

crypto/asn1/a_time.c:112:2: return from a call to ASN1_TIME_set
      110.   					return ASN1_UTCTIME_set(s, t);
      111.   	return ASN1_GENERALIZEDTIME_set(s,t);
      112.   	}
              ^
      113.   
      114.   int ASN1_TIME_check(ASN1_TIME *t)

crypto/x509/x509_vfy.c:850:2: return from a call to X509_time_adj
    848.   	if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t);
    849.   	return ASN1_TIME_set(s, t);
    850.   	}
            ^
    851.   
    852.   int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)

crypto/x509/x509_vfy.c:835:1: return from a call to X509_gmtime_adj
  833.   {
  834.   	return X509_time_adj(s, adj, NULL);
  835. > }
  836.   
  837.   ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm)

apps/ca.c:2939:2: 
2937.   	revtm = X509_gmtime_adj(NULL, 0);
2938.   
2939. > 	i = revtm->length + 1;
2940.   
2941.   	if (reason) i += strlen(reason) + 1;
