crypto/x509v3/v3_scts.c:114: error: BUFFER_OVERRUN_L3
  Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`.
Showing all 11 steps of the trace


crypto/x509v3/v3_scts.c:104:2: Call
102.   	char genstr[20];
103.   	gen = ASN1_GENERALIZEDTIME_new();
104.   	ASN1_GENERALIZEDTIME_adj(gen, (time_t)0,
        ^
105.   					(int)(timestamp / 86400000),
106.   					(timestamp % 86400000) / 1000);

crypto/asn1/a_gentm.c:264:1: Parameter `*s->data`
  262.   	}
  263.   
  264. > ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
  265.   	     time_t t, int offset_day, long offset_sec)
  266.   	{

crypto/x509v3/v3_scts.c:113:2: Call
111.   				ASN1_STRING_data(gen),
112.   				(unsigned int)(timestamp % 1000));
113.   	ASN1_GENERALIZEDTIME_set_string(gen, genstr);
        ^
114.   	ASN1_GENERALIZEDTIME_print(out, gen);
115.   	ASN1_GENERALIZEDTIME_free(gen);

crypto/asn1/a_gentm.c:236:1: Parameter `*s->data`
  234.   	}
  235.   
  236. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
  237.   	{
  238.   	ASN1_GENERALIZEDTIME t;

crypto/x509v3/v3_scts.c:114:2: Call
112.   				(unsigned int)(timestamp % 1000));
113.   	ASN1_GENERALIZEDTIME_set_string(gen, genstr);
114.   	ASN1_GENERALIZEDTIME_print(out, gen);
        ^
115.   	ASN1_GENERALIZEDTIME_free(gen);
116.   	}

crypto/asn1/t_x509.c:404:1: <Offset trace>
402.       };
403.   
404. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
405.   	{
406.   	char *v;

crypto/asn1/t_x509.c:404:1: Parameter `*tm->data`
  402.       };
  403.   
  404. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
  405.   	{
  406.   	char *v;

crypto/asn1/t_x509.c:421:2: Assignment
  419.   		if ((v[i] > '9') || (v[i] < '0')) goto err;
  420.   	y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0');
  421.   	M= (v[4]-'0')*10+(v[5]-'0');
          ^
  422.   	if ((M > 12) || (M < 1)) goto err;
  423.   	d= (v[6]-'0')*10+(v[7]-'0');

crypto/asn1/t_x509.c:398:1: <Length trace>
396.   }
397.   
398. > static const char *mon[12]=
399.       {
400.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:398:1: Array declaration
  396.   }
  397.   
  398. > static const char *mon[12]=
  399.       {
  400.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:443:3: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 
  441.   
  442.   	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",
  443.   		mon[M-1],d,h,m,s,f_len,f,y,(gmt)?" GMT":"") <= 0)
           ^
  444.   		return(0);
  445.   	else

int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
	{
	char *v;
	int gmt=0;
	int i;
	int y=0,M=0,d=0,h=0,m=0,s=0;
	char *f = NULL;
	int f_len = 0;
	i=tm->length;
	v=(char *)tm->data;
	if (i < 12) goto err;
	if (v[i-1] == 'Z') gmt=1;
	for (i=0; i<12; i++)
		if ((v[i] > '9') || (v[i] < '0')) goto err;
	y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0');
	M= (v[4]-'0')*10+(v[5]-'0');
	if ((M > 12) || (M < 1)) goto err;
	d= (v[6]-'0')*10+(v[7]-'0');
	h= (v[8]-'0')*10+(v[9]-'0');
	m=  (v[10]-'0')*10+(v[11]-'0');
	if (tm->length >= 14 &&
	    (v[12] >= '0') && (v[12] <= '9') &&
	    (v[13] >= '0') && (v[13] <= '9'))
		{
		s=  (v[12]-'0')*10+(v[13]-'0');
		if (tm->length >= 15 && v[14] == '.')
			{
			int l = tm->length;
			f = &v[14];
			f_len = 1;
			while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9')
				++f_len;
			}
		}
	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",
		mon[M-1],d,h,m,s,f_len,f,y,(gmt)?" GMT":"") <= 0)
		return(0);
	else
		return(1);
err:
	BIO_write(bp,"Bad time value",14);
	return(0);
	}
['static void timestamp_print(BIO *out, BN_ULLONG timestamp)\n\t{\n\tASN1_GENERALIZEDTIME *gen;\n\tchar genstr[20];\n\tgen = ASN1_GENERALIZEDTIME_new();\n\tASN1_GENERALIZEDTIME_adj(gen, (time_t)0,\n\t\t\t\t\t(int)(timestamp / 86400000),\n\t\t\t\t\t(timestamp % 86400000) / 1000);\n\tBIO_snprintf(genstr, sizeof(genstr), "%.14s.%03dZ",\n\t\t\t\tASN1_STRING_data(gen),\n\t\t\t\t(unsigned int)(timestamp % 1000));\n\tASN1_GENERALIZEDTIME_set_string(gen, genstr);\n\tASN1_GENERALIZEDTIME_print(out, gen);\n\tASN1_GENERALIZEDTIME_free(gen);\n\t}', 'ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,\n\t     time_t t, int offset_day, long offset_sec)\n\t{\n\tchar *p;\n\tstruct tm *ts;\n\tstruct tm data;\n\tsize_t len = 20;\n\tif (s == NULL)\n\t\ts=M_ASN1_GENERALIZEDTIME_new();\n\tif (s == NULL)\n\t\treturn(NULL);\n\tts=OPENSSL_gmtime(&t, &data);\n\tif (ts == NULL)\n\t\treturn(NULL);\n\tif (offset_day || offset_sec)\n\t\t{\n\t\tif (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))\n\t\t\treturn NULL;\n\t\t}\n\tp=(char *)s->data;\n\tif ((p == NULL) || ((size_t)s->length < len))\n\t\t{\n\t\tp=OPENSSL_malloc(len);\n\t\tif (p == NULL)\n\t\t\t{\n\t\t\tASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ,\n\t\t\t\tERR_R_MALLOC_FAILURE);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\tif (s->data != NULL)\n\t\t\tOPENSSL_free(s->data);\n\t\ts->data=(unsigned char *)p;\n\t\t}\n\tBIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,\n\t\t     ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);\n\ts->length=strlen(p);\n\ts->type=V_ASN1_GENERALIZEDTIME;\n#ifdef CHARSET_EBCDIC_not\n\tebcdic2ascii(s->data, s->data, s->length);\n#endif\n\treturn(s);\n\t}', 'int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)\n\t{\n\tASN1_GENERALIZEDTIME t;\n\tt.type=V_ASN1_GENERALIZEDTIME;\n\tt.length=strlen(str);\n\tt.data=(unsigned char *)str;\n\tif (ASN1_GENERALIZEDTIME_check(&t))\n\t\t{\n\t\tif (s != NULL)\n\t\t\t{\n\t\t\tif (!ASN1_STRING_set((ASN1_STRING *)s,\n\t\t\t\t(unsigned char *)str,t.length))\n\t\t\t\treturn 0;\n\t\t\ts->type=V_ASN1_GENERALIZEDTIME;\n\t\t\t}\n\t\treturn(1);\n\t\t}\n\telse\n\t\treturn(0);\n\t}', 'int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)\n\t{\n\tchar *v;\n\tint gmt=0;\n\tint i;\n\tint y=0,M=0,d=0,h=0,m=0,s=0;\n\tchar *f = NULL;\n\tint f_len = 0;\n\ti=tm->length;\n\tv=(char *)tm->data;\n\tif (i < 12) goto err;\n\tif (v[i-1] == \'Z\') gmt=1;\n\tfor (i=0; i<12; i++)\n\t\tif ((v[i] > \'9\') || (v[i] < \'0\')) goto err;\n\ty= (v[0]-\'0\')*1000+(v[1]-\'0\')*100 + (v[2]-\'0\')*10+(v[3]-\'0\');\n\tM= (v[4]-\'0\')*10+(v[5]-\'0\');\n\tif ((M > 12) || (M < 1)) goto err;\n\td= (v[6]-\'0\')*10+(v[7]-\'0\');\n\th= (v[8]-\'0\')*10+(v[9]-\'0\');\n\tm=  (v[10]-\'0\')*10+(v[11]-\'0\');\n\tif (tm->length >= 14 &&\n\t    (v[12] >= \'0\') && (v[12] <= \'9\') &&\n\t    (v[13] >= \'0\') && (v[13] <= \'9\'))\n\t\t{\n\t\ts=  (v[12]-\'0\')*10+(v[13]-\'0\');\n\t\tif (tm->length >= 15 && v[14] == \'.\')\n\t\t\t{\n\t\t\tint l = tm->length;\n\t\t\tf = &v[14];\n\t\t\tf_len = 1;\n\t\t\twhile (14 + f_len < l && f[f_len] >= \'0\' && f[f_len] <= \'9\')\n\t\t\t\t++f_len;\n\t\t\t}\n\t\t}\n\tif (BIO_printf(bp,"%s %2d %02d:%02d:%02d%.*s %d%s",\n\t\tmon[M-1],d,h,m,s,f_len,f,y,(gmt)?" GMT":"") <= 0)\n\t\treturn(0);\n\telse\n\t\treturn(1);\nerr:\n\tBIO_write(bp,"Bad time value",14);\n\treturn(0);\n\t}']