crypto/asn1/t_crl.c:129: error: BUFFER_OVERRUN_L3
  Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`.
Showing all 13 steps of the trace


crypto/asn1/t_crl.c:101:2: Call
99.   	BIO_printf(out, "%8sSignature Algorithm: %s\n", "",
100.   				 (i == NID_undef) ? "NONE" : OBJ_nid2ln(i));
101.   	X509_NAME_oneline(X509_CRL_get_issuer(x),buf,256);
        ^
102.   	BIO_printf(out,"%8sIssuer: %s\n","",buf);
103.   	BIO_printf(out,"%8sLast Update: ","");

crypto/x509/x509_obj.c:86:3: Assignment
  84.   		if ((b=BUF_MEM_new()) == NULL) goto err;
  85.   		if (!BUF_MEM_grow(b,200)) goto err;
  86.   		b->data[0]='\0';
          ^
  87.   		len=200;
  88.   		}

crypto/asn1/t_crl.c:127:3: Call
125.   		r = sk_X509_REVOKED_value(rev, i);
126.   		BIO_printf(out,"    Serial Number: ");
127.   		i2a_ASN1_INTEGER(out,r->serialNumber);
         ^
128.   		BIO_printf(out,"\n        Revocation Date: ","");
129.   		ASN1_TIME_print(out,r->revocationDate);

crypto/asn1/f_int.c:64:1: Parameter `*a->data`
  62.   #include <openssl/asn1.h>
  63.   
  64. > int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)
  65.   	{
  66.   	int i,n=0;

crypto/asn1/t_crl.c:129:3: Call
127.   		i2a_ASN1_INTEGER(out,r->serialNumber);
128.   		BIO_printf(out,"\n        Revocation Date: ","");
129.   		ASN1_TIME_print(out,r->revocationDate);
         ^
130.   		BIO_printf(out,"\n");
131.   		for(j = 0; j < X509_REVOKED_get_ext_count(r); j++)

crypto/asn1/t_x509.c:259:1: Parameter `*tm->data`
  257.   	}
  258.   
  259. > int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm)
  260.   {
  261.   	if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);

crypto/asn1/t_x509.c:263:12: Call
  261.   	if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);
  262.   	if(tm->type == V_ASN1_GENERALIZEDTIME)
  263.   				return ASN1_GENERALIZEDTIME_print(bp, tm);
                    ^
  264.   	BIO_write(bp,"Bad time value",14);
  265.   	return(0);

crypto/asn1/t_x509.c:274:1: <Offset trace>
272.       };
273.   
274. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
275.   	{
276.   	char *v;

crypto/asn1/t_x509.c:274:1: Parameter `*tm->data`
    272.       };
    273.   
    274. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
    275.   	{
    276.   	char *v;

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

crypto/asn1/t_x509.c:268:1: <Length trace>
266.   }
267.   
268. > static const char *mon[12]=
269.       {
270.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:268:1: Array declaration
    266.   }
    267.   
    268. > static const char *mon[12]=
    269.       {
    270.       "Jan","Feb","Mar","Apr","May","Jun",

crypto/asn1/t_x509.c:299:3: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print` 
    297.   
    298.   	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
    299.   		mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0)
             ^
    300.   		return(0);
    301.   	else

int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
	{
	char *v;
	int gmt=0;
	int i;
	int y=0,M=0,d=0,h=0,m=0,s=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 (	(v[12] >= '0') && (v[12] <= '9') &&
		(v[13] >= '0') && (v[13] <= '9'))
		s=  (v[12]-'0')*10+(v[13]-'0');
	if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
		mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0)
		return(0);
	else
		return(1);
err:
	BIO_write(bp,"Bad time value",14);
	return(0);
	}
['int X509_CRL_print(BIO *out, X509_CRL *x)\n{\n\tchar buf[256];\n\tunsigned char *s;\n\tSTACK_OF(X509_REVOKED) *rev;\n\tX509_REVOKED *r;\n\tlong l;\n\tint i, j, n;\n\tBIO_printf(out, "Certificate Revocation List (CRL):\\n");\n\tl = X509_CRL_get_version(x);\n\tBIO_printf(out, "%8sVersion %lu (0x%lx)\\n", "", l+1, l);\n\ti = OBJ_obj2nid(x->sig_alg->algorithm);\n\tBIO_printf(out, "%8sSignature Algorithm: %s\\n", "",\n\t\t\t\t (i == NID_undef) ? "NONE" : OBJ_nid2ln(i));\n\tX509_NAME_oneline(X509_CRL_get_issuer(x),buf,256);\n\tBIO_printf(out,"%8sIssuer: %s\\n","",buf);\n\tBIO_printf(out,"%8sLast Update: ","");\n\tASN1_TIME_print(out,X509_CRL_get_lastUpdate(x));\n\tBIO_printf(out,"\\n%8sNext Update: ","");\n\tif (X509_CRL_get_nextUpdate(x))\n\t\t ASN1_TIME_print(out,X509_CRL_get_nextUpdate(x));\n\telse BIO_printf(out,"NONE");\n\tBIO_printf(out,"\\n");\n\tn=X509_CRL_get_ext_count(x);\n\tif (n > 0) {\n\t\tBIO_printf(out,"%8sCRL extensions:\\n","");\n\t\tfor (i=0; i<n; i++) ext_print(out, X509_CRL_get_ext(x, i));\n\t}\n\trev = X509_CRL_get_REVOKED(x);\n\tif(sk_X509_REVOKED_num(rev))\n\t    BIO_printf(out, "Revoked Certificates:\\n");\n\telse BIO_printf(out, "No Revoked Certificates.\\n");\n\tfor(i = 0; i < sk_X509_REVOKED_num(rev); i++) {\n\t\tr = sk_X509_REVOKED_value(rev, i);\n\t\tBIO_printf(out,"    Serial Number: ");\n\t\ti2a_ASN1_INTEGER(out,r->serialNumber);\n\t\tBIO_printf(out,"\\n        Revocation Date: ","");\n\t\tASN1_TIME_print(out,r->revocationDate);\n\t\tBIO_printf(out,"\\n");\n\t\tfor(j = 0; j < X509_REVOKED_get_ext_count(r); j++)\n\t\t\t\text_print(out, X509_REVOKED_get_ext(r, j));\n\t}\n\ti=OBJ_obj2nid(x->sig_alg->algorithm);\n\tBIO_printf(out,"    Signature Algorithm: %s",\n\t\t\t\t(i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i));\n\ts = x->signature->data;\n\tn = x->signature->length;\n\tfor (i=0; i<n; i++, s++)\n\t{\n\t\tif ((i%18) == 0) BIO_write(out,"\\n        ",9);\n\t\tBIO_printf(out,"%02x%s",*s, ((i+1) == n)?"":":");\n\t}\n\tBIO_write(out,"\\n",1);\n\treturn 1;\n}', 'char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)\n\t{\n\tX509_NAME_ENTRY *ne;\nint i;\n\tint n,lold,l,l1,l2,num,j,type;\n\tconst char *s;\n\tchar *p;\n\tunsigned char *q;\n\tBUF_MEM *b=NULL;\n\tstatic char hex[17]="0123456789ABCDEF";\n\tint gs_doit[4];\n\tchar tmp_buf[80];\n#ifdef CHARSET_EBCDIC\n\tchar ebcdic_buf[1024];\n#endif\n\tif (buf == NULL)\n\t\t{\n\t\tif ((b=BUF_MEM_new()) == NULL) goto err;\n\t\tif (!BUF_MEM_grow(b,200)) goto err;\n\t\tb->data[0]=\'\\0\';\n\t\tlen=200;\n\t\t}\n\tif (a == NULL)\n\t    {\n\t    if(b)\n\t\t{\n\t\tbuf=b->data;\n\t\tOPENSSL_free(b);\n\t\t}\n\t    strncpy(buf,"NO X509_NAME",len);\n\t    return buf;\n\t    }\n\tlen--;\n\tl=0;\n\tfor (i=0; i<sk_X509_NAME_ENTRY_num(a->entries); i++)\n\t\t{\n\t\tne=sk_X509_NAME_ENTRY_value(a->entries,i);\n\t\tn=OBJ_obj2nid(ne->object);\n\t\tif ((n == NID_undef) || ((s=OBJ_nid2sn(n)) == NULL))\n\t\t\t{\n\t\t\ti2t_ASN1_OBJECT(tmp_buf,sizeof(tmp_buf),ne->object);\n\t\t\ts=tmp_buf;\n\t\t\t}\n\t\tl1=strlen(s);\n\t\ttype=ne->value->type;\n\t\tnum=ne->value->length;\n\t\tq=ne->value->data;\n#ifdef CHARSET_EBCDIC\n                if (type == V_ASN1_GENERALSTRING ||\n\t\t    type == V_ASN1_VISIBLESTRING ||\n\t\t    type == V_ASN1_PRINTABLESTRING ||\n\t\t    type == V_ASN1_TELETEXSTRING ||\n\t\t    type == V_ASN1_VISIBLESTRING ||\n\t\t    type == V_ASN1_IA5STRING) {\n                        ascii2ebcdic(ebcdic_buf, q,\n\t\t\t\t     (num > sizeof ebcdic_buf)\n\t\t\t\t     ? sizeof ebcdic_buf : num);\n                        q=ebcdic_buf;\n\t\t}\n#endif\n\t\tif ((type == V_ASN1_GENERALSTRING) && ((num%4) == 0))\n\t\t\t{\n\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=0;\n\t\t\tfor (j=0; j<num; j++)\n\t\t\t\tif (q[j] != 0) gs_doit[j&3]=1;\n\t\t\tif (gs_doit[0]|gs_doit[1]|gs_doit[2])\n\t\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=1;\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=0;\n\t\t\t\tgs_doit[3]=1;\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\tgs_doit[0]=gs_doit[1]=gs_doit[2]=gs_doit[3]=1;\n\t\tfor (l2=j=0; j<num; j++)\n\t\t\t{\n\t\t\tif (!gs_doit[j&3]) continue;\n\t\t\tl2++;\n#ifndef CHARSET_EBCDIC\n\t\t\tif ((q[j] < \' \') || (q[j] > \'~\')) l2+=3;\n#else\n\t\t\tif ((os_toascii[q[j]] < os_toascii[\' \']) ||\n\t\t\t    (os_toascii[q[j]] > os_toascii[\'~\'])) l2+=3;\n#endif\n\t\t\t}\n\t\tlold=l;\n\t\tl+=1+l1+1+l2;\n\t\tif (b != NULL)\n\t\t\t{\n\t\t\tif (!BUF_MEM_grow(b,l+1)) goto err;\n\t\t\tp= &(b->data[lold]);\n\t\t\t}\n\t\telse if (l > len)\n\t\t\t{\n\t\t\tbreak;\n\t\t\t}\n\t\telse\n\t\t\tp= &(buf[lold]);\n\t\t*(p++)=\'/\';\n\t\tmemcpy(p,s,(unsigned int)l1); p+=l1;\n\t\t*(p++)=\'=\';\n#ifndef CHARSET_EBCDIC\n\t\tq=ne->value->data;\n#endif\n\t\tfor (j=0; j<num; j++)\n\t\t\t{\n\t\t\tif (!gs_doit[j&3]) continue;\n#ifndef CHARSET_EBCDIC\n\t\t\tn=q[j];\n\t\t\tif ((n < \' \') || (n > \'~\'))\n\t\t\t\t{\n\t\t\t\t*(p++)=\'\\\\\';\n\t\t\t\t*(p++)=\'x\';\n\t\t\t\t*(p++)=hex[(n>>4)&0x0f];\n\t\t\t\t*(p++)=hex[n&0x0f];\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t*(p++)=n;\n#else\n\t\t\tn=os_toascii[q[j]];\n\t\t\tif ((n < os_toascii[\' \']) ||\n\t\t\t    (n > os_toascii[\'~\']))\n\t\t\t\t{\n\t\t\t\t*(p++)=\'\\\\\';\n\t\t\t\t*(p++)=\'x\';\n\t\t\t\t*(p++)=hex[(n>>4)&0x0f];\n\t\t\t\t*(p++)=hex[n&0x0f];\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t*(p++)=q[j];\n#endif\n\t\t\t}\n\t\t*p=\'\\0\';\n\t\t}\n\tif (b != NULL)\n\t\t{\n\t\tp=b->data;\n\t\tOPENSSL_free(b);\n\t\t}\n\telse\n\t\tp=buf;\n\treturn(p);\nerr:\n\tX509err(X509_F_X509_NAME_ONELINE,ERR_R_MALLOC_FAILURE);\n\tif (b != NULL) BUF_MEM_free(b);\n\treturn(NULL);\n\t}', 'int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a)\n\t{\n\tint i,n=0;\n\tstatic const char *h="0123456789ABCDEF";\n\tchar buf[2];\n\tif (a == NULL) return(0);\n\tif (a->length == 0)\n\t\t{\n\t\tif (BIO_write(bp,"00",2) != 2) goto err;\n\t\tn=2;\n\t\t}\n\telse\n\t\t{\n\t\tfor (i=0; i<a->length; i++)\n\t\t\t{\n\t\t\tif ((i != 0) && (i%35 == 0))\n\t\t\t\t{\n\t\t\t\tif (BIO_write(bp,"\\\\\\n",2) != 2) goto err;\n\t\t\t\tn+=2;\n\t\t\t\t}\n\t\t\tbuf[0]=h[((unsigned char)a->data[i]>>4)&0x0f];\n\t\t\tbuf[1]=h[((unsigned char)a->data[i]   )&0x0f];\n\t\t\tif (BIO_write(bp,buf,2) != 2) goto err;\n\t\t\tn+=2;\n\t\t\t}\n\t\t}\n\treturn(n);\nerr:\n\treturn(-1);\n\t}', 'int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm)\n{\n\tif(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);\n\tif(tm->type == V_ASN1_GENERALIZEDTIME)\n\t\t\t\treturn ASN1_GENERALIZEDTIME_print(bp, tm);\n\tBIO_write(bp,"Bad time value",14);\n\treturn(0);\n}', 'int ASN1_GENERALIZEDTIME_print(BIO *bp, 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\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 (\t(v[12] >= \'0\') && (v[12] <= \'9\') &&\n\t\t(v[13] >= \'0\') && (v[13] <= \'9\'))\n\t\ts=  (v[12]-\'0\')*10+(v[13]-\'0\');\n\tif (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",\n\t\tmon[M-1],d,h,m,s,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}']