crypto/asn1/asn1_par.c:162: error: BUFFER_OVERRUN_L2
  Offset: [0, 30] Size: 30 by call to `asn1_print_info`.
Showing all 10 steps of the trace


crypto/asn1/asn1_par.c:133:5: Call
131.   		{
132.   		op=p;
133.   		j=ASN1_get_object(&p,&len,&tag,&xclass,length);
           ^
134.   #ifdef LINT
135.   		j=j;

crypto/asn1/asn1_lib.c:83:1: Parameter `*ptag`
  81.   
  82.   
  83. > int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,
  84.   	     long omax)
  85.   	{

crypto/asn1/asn1_par.c:162:8: Call
160.   				goto end;
161.   			}
162.   		if (!asn1_print_info(bp,tag,xclass,j,(indent)?depth:0))
              ^
163.   			goto end;
164.   		if (j & V_ASN1_CONSTRUCTED)

crypto/asn1/asn1_par.c:69:1: Parameter `tag`
  67.   static int asn1_parse2(BIO *bp, unsigned char **pp, long length,
  68.   	int offset, int depth, int indent);
  69. > static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
  70.   	     int indent)
  71.   	{

crypto/asn1/asn1_par.c:96:11: Call
  94.   	else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
  95.   		sprintf(str,"appl [ %d ]",tag);
  96.   	else p = ASN1_tag2str(tag);
                  ^
  97.   
  98.   	if (p2 != NULL)

crypto/asn1/asn1_par.c:366:1: <Offset trace>
364.   	}
365.   
366. > const char *ASN1_tag2str(int tag)
367.   {
368.   	const static char *tag2str[] = {

crypto/asn1/asn1_par.c:366:1: Parameter `tag`
    364.   	}
    365.   
    366. > const char *ASN1_tag2str(int tag)
    367.   {
    368.   	const static char *tag2str[] = {

crypto/asn1/asn1_par.c:368:2: <Length trace>
366.   const char *ASN1_tag2str(int tag)
367.   {
368.   	const static char *tag2str[] = {
        ^
369.   	 "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */
370.   	 "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */

crypto/asn1/asn1_par.c:368:2: Array declaration
    366.   const char *ASN1_tag2str(int tag)
    367.   {
    368.   	const static char *tag2str[] = {
            ^
    369.   	 "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */
    370.   	 "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */

crypto/asn1/asn1_par.c:383:9: Array access: Offset: [0, 30] Size: 30 by call to `asn1_print_info` 
    381.   
    382.   	if(tag < 0 || tag > 30) return "(unknown)";
    383.   	return tag2str[tag];
                   ^
    384.   }
    385.   

const char *ASN1_tag2str(int tag)
{
	const static char *tag2str[] = {
	 "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING",
	 "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",
	 "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",
	"<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",
	"NUMERICSTRING", "PRINTABLESTRING", "T61STRING",
	"VIDEOTEXSTRING", "IA5STRING", "UTCTIME" "GENERALIZEDTIME",
	"GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",
	"UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"
	};
	if((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))
							tag &= ~0x100;
	if(tag < 0 || tag > 30) return "(unknown)";
	return tag2str[tag];
}
['static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,\n\t     int depth, int indent)\n\t{\n\tunsigned char *p,*ep,*tot,*op,*opp;\n\tlong len;\n\tint tag,xclass,ret=0;\n\tint nl,hl,j,r;\n\tASN1_OBJECT *o=NULL;\n\tASN1_OCTET_STRING *os=NULL;\n\tp= *pp;\n\ttot=p+length;\n\top=p-1;\n\twhile ((p < tot) && (op < p))\n\t\t{\n\t\top=p;\n\t\tj=ASN1_get_object(&p,&len,&tag,&xclass,length);\n#ifdef LINT\n\t\tj=j;\n#endif\n\t\tif (j & 0x80)\n\t\t\t{\n\t\t\tif (BIO_write(bp,"Error in encoding\\n",18) <= 0)\n\t\t\t\tgoto end;\n\t\t\tret=0;\n\t\t\tgoto end;\n\t\t\t}\n\t\thl=(p-op);\n\t\tlength-=hl;\n\t\tif (BIO_printf(bp,"%5ld:",(long)offset+(long)(op- *pp))\n\t\t\t<= 0) goto end;\n\t\tif (j != (V_ASN1_CONSTRUCTED | 1))\n\t\t\t{\n\t\t\tif (BIO_printf(bp,"d=%-2d hl=%ld l=%4ld ",\n\t\t\t\tdepth,(long)hl,len) <= 0)\n\t\t\t\tgoto end;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (BIO_printf(bp,"d=%-2d hl=%ld l=inf  ",\n\t\t\t\tdepth,(long)hl) <= 0)\n\t\t\t\tgoto end;\n\t\t\t}\n\t\tif (!asn1_print_info(bp,tag,xclass,j,(indent)?depth:0))\n\t\t\tgoto end;\n\t\tif (j & V_ASN1_CONSTRUCTED)\n\t\t\t{\n\t\t\tep=p+len;\n\t\t\tif (BIO_write(bp,"\\n",1) <= 0) goto end;\n\t\t\tif (len > length)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bp,\n\t\t\t\t\t"length is greater than %ld\\n",length);\n\t\t\t\tret=0;\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\tif ((j == 0x21) && (len == 0))\n\t\t\t\t{\n\t\t\t\tfor (;;)\n\t\t\t\t\t{\n\t\t\t\t\tr=asn1_parse2(bp,&p,(long)(tot-p),\n\t\t\t\t\t\toffset+(p - *pp),depth+1,\n\t\t\t\t\t\tindent);\n\t\t\t\t\tif (r == 0) { ret=0; goto end; }\n\t\t\t\t\tif ((r == 2) || (p >= tot)) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\twhile (p < ep)\n\t\t\t\t\t{\n\t\t\t\t\tr=asn1_parse2(bp,&p,(long)len,\n\t\t\t\t\t\toffset+(p - *pp),depth+1,\n\t\t\t\t\t\tindent);\n\t\t\t\t\tif (r == 0) { ret=0; goto end; }\n\t\t\t\t\t}\n\t\t\t}\n\t\telse if (xclass != 0)\n\t\t\t{\n\t\t\tp+=len;\n\t\t\tif (BIO_write(bp,"\\n",1) <= 0) goto end;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tnl=0;\n\t\t\tif (\t(tag == V_ASN1_PRINTABLESTRING) ||\n\t\t\t\t(tag == V_ASN1_T61STRING) ||\n\t\t\t\t(tag == V_ASN1_IA5STRING) ||\n\t\t\t\t(tag == V_ASN1_VISIBLESTRING) ||\n\t\t\t\t(tag == V_ASN1_UTCTIME) ||\n\t\t\t\t(tag == V_ASN1_GENERALIZEDTIME))\n\t\t\t\t{\n\t\t\t\tif (BIO_write(bp,":",1) <= 0) goto end;\n\t\t\t\tif ((len > 0) &&\n\t\t\t\t\tBIO_write(bp,(char *)p,(int)len)\n\t\t\t\t\t!= (int)len)\n\t\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\telse if (tag == V_ASN1_OBJECT)\n\t\t\t\t{\n\t\t\t\topp=op;\n\t\t\t\tif (d2i_ASN1_OBJECT(&o,&opp,len+hl) != NULL)\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,":",1) <= 0) goto end;\n\t\t\t\t\ti2a_ASN1_OBJECT(bp,o);\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,":BAD OBJECT",11) <= 0)\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse if (tag == V_ASN1_BOOLEAN)\n\t\t\t\t{\n\t\t\t\tint ii;\n\t\t\t\topp=op;\n\t\t\t\tii=d2i_ASN1_BOOLEAN(NULL,&opp,len+hl);\n\t\t\t\tif (ii < 0)\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,"Bad boolean\\n",12))\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\tBIO_printf(bp,":%d",ii);\n\t\t\t\t}\n\t\t\telse if (tag == V_ASN1_BMPSTRING)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\telse if (tag == V_ASN1_OCTET_STRING)\n\t\t\t\t{\n\t\t\t\tint i,printable=1;\n\t\t\t\topp=op;\n\t\t\t\tos=d2i_ASN1_OCTET_STRING(NULL,&opp,len+hl);\n\t\t\t\tif (os != NULL)\n\t\t\t\t\t{\n\t\t\t\t\topp=os->data;\n\t\t\t\t\tfor (i=0; i<os->length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif ((\t(opp[i] < \' \') &&\n\t\t\t\t\t\t\t(opp[i] != \'\\n\') &&\n\t\t\t\t\t\t\t(opp[i] != \'\\r\') &&\n\t\t\t\t\t\t\t(opp[i] != \'\\t\')) ||\n\t\t\t\t\t\t\t(opp[i] > \'~\'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprintable=0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tif (printable && (os->length > 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (BIO_write(bp,":",1) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\t\tif (BIO_write(bp,(char *)opp,\n\t\t\t\t\t\t\tos->length) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\t\t}\n\t\t\t\t\tASN1_OCTET_STRING_free(os);\n\t\t\t\t\tos=NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse if (tag == V_ASN1_INTEGER)\n\t\t\t\t{\n\t\t\t\tASN1_INTEGER *bs;\n\t\t\t\tint i;\n\t\t\t\topp=op;\n\t\t\t\tbs=d2i_ASN1_INTEGER(NULL,&opp,len+hl);\n\t\t\t\tif (bs != NULL)\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,":",1) <= 0) goto end;\n\t\t\t\t\tif (bs->type == V_ASN1_NEG_INTEGER)\n\t\t\t\t\t\tif (BIO_write(bp,"-",1) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\tfor (i=0; i<bs->length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (BIO_printf(bp,"%02X",\n\t\t\t\t\t\t\tbs->data[i]) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\t\t}\n\t\t\t\t\tif (bs->length == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (BIO_write(bp,"00",2) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,"BAD INTEGER",11) <= 0)\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\tASN1_INTEGER_free(bs);\n\t\t\t\t}\n\t\t\telse if (tag == V_ASN1_ENUMERATED)\n\t\t\t\t{\n\t\t\t\tASN1_ENUMERATED *bs;\n\t\t\t\tint i;\n\t\t\t\topp=op;\n\t\t\t\tbs=d2i_ASN1_ENUMERATED(NULL,&opp,len+hl);\n\t\t\t\tif (bs != NULL)\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,":",1) <= 0) goto end;\n\t\t\t\t\tif (bs->type == V_ASN1_NEG_ENUMERATED)\n\t\t\t\t\t\tif (BIO_write(bp,"-",1) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\tfor (i=0; i<bs->length; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (BIO_printf(bp,"%02X",\n\t\t\t\t\t\t\tbs->data[i]) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\t\t}\n\t\t\t\t\tif (bs->length == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (BIO_write(bp,"00",2) <= 0)\n\t\t\t\t\t\t\tgoto end;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tif (BIO_write(bp,"BAD ENUMERATED",11) <= 0)\n\t\t\t\t\t\tgoto end;\n\t\t\t\t\t}\n\t\t\t\tASN1_ENUMERATED_free(bs);\n\t\t\t\t}\n\t\t\tif (!nl)\n\t\t\t\t{\n\t\t\t\tif (BIO_write(bp,"\\n",1) <= 0) goto end;\n\t\t\t\t}\n\t\t\tp+=len;\n\t\t\tif ((tag == V_ASN1_EOC) && (xclass == 0))\n\t\t\t\t{\n\t\t\t\tret=2;\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\t}\n\t\tlength-=len;\n\t\t}\n\tret=1;\nend:\n\tif (o != NULL) ASN1_OBJECT_free(o);\n\tif (os != NULL) ASN1_OCTET_STRING_free(os);\n\t*pp=p;\n\treturn(ret);\n\t}', 'int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass,\n\t     long omax)\n\t{\n\tint i,ret;\n\tlong l;\n\tunsigned char *p= *pp;\n\tint tag,xclass,inf;\n\tlong max=omax;\n\tif (!max) goto err;\n\tret=(*p&V_ASN1_CONSTRUCTED);\n\txclass=(*p&V_ASN1_PRIVATE);\n\ti= *p&V_ASN1_PRIMITIVE_TAG;\n\tif (i == V_ASN1_PRIMITIVE_TAG)\n\t\t{\n\t\tp++;\n\t\tif (--max == 0) goto err;\n\t\tl=0;\n\t\twhile (*p&0x80)\n\t\t\t{\n\t\t\tl<<=7L;\n\t\t\tl|= *(p++)&0x7f;\n\t\t\tif (--max == 0) goto err;\n\t\t\t}\n\t\tl<<=7L;\n\t\tl|= *(p++)&0x7f;\n\t\ttag=(int)l;\n\t\t}\n\telse\n\t\t{\n\t\ttag=i;\n\t\tp++;\n\t\tif (--max == 0) goto err;\n\t\t}\n\t*ptag=tag;\n\t*pclass=xclass;\n\tif (!asn1_get_length(&p,&inf,plength,(int)max)) goto err;\n#if 0\n\tfprintf(stderr,"p=%d + *plength=%ld > omax=%ld + *pp=%d  (%d > %d)\\n",\n\t\t(int)p,*plength,omax,(int)*pp,(int)(p+ *plength),\n\t\t(int)(omax+ *pp));\n#endif\n#if 0\n\tif ((p+ *plength) > (omax+ *pp))\n\t\t{\n\t\tASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_TOO_LONG);\n\t\tret|=0x80;\n\t\t}\n#endif\n\t*pp=p;\n\treturn(ret|inf);\nerr:\n\tASN1err(ASN1_F_ASN1_GET_OBJECT,ASN1_R_HEADER_TOO_LONG);\n\treturn(0x80);\n\t}', 'static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,\n\t     int indent)\n\t{\n\tstatic const char fmt[]="%-18s";\n\tstatic const char fmt2[]="%2d %-15s";\n\tchar str[128];\n\tconst char *p,*p2=NULL;\n\tif (constructed & V_ASN1_CONSTRUCTED)\n\t\tp="cons: ";\n\telse\n\t\tp="prim: ";\n\tif (BIO_write(bp,p,6) < 6) goto err;\n\tif (indent)\n\t\t{\n\t\tif (indent > 128) indent=128;\n\t\tmemset(str,\' \',indent);\n\t\tif (BIO_write(bp,str,indent) < indent) goto err;\n\t\t}\n\tp=str;\n\tif ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)\n\t\tsprintf(str,"priv [ %d ] ",tag);\n\telse if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)\n\t\tsprintf(str,"cont [ %d ]",tag);\n\telse if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)\n\t\tsprintf(str,"appl [ %d ]",tag);\n\telse p = ASN1_tag2str(tag);\n\tif (p2 != NULL)\n\t\t{\n\t\tif (BIO_printf(bp,fmt2,tag,p2) <= 0) goto err;\n\t\t}\n\telse\n\t\t{\n\t\tif (BIO_printf(bp,fmt,p) <= 0) goto err;\n\t\t}\n\treturn(1);\nerr:\n\treturn(0);\n\t}', 'const char *ASN1_tag2str(int tag)\n{\n\tconst static char *tag2str[] = {\n\t "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING",\n\t "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL",\n\t "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",\n\t"<ASN1 14>", "<ASN1 15>", "SEQUENCE", "SET",\n\t"NUMERICSTRING", "PRINTABLESTRING", "T61STRING",\n\t"VIDEOTEXSTRING", "IA5STRING", "UTCTIME" "GENERALIZEDTIME",\n\t"GRAPHICSTRING", "VISIBLESTRING", "GENERALSTRING",\n\t"UNIVERSALSTRING", "<ASN1 29>", "BMPSTRING"\n\t};\n\tif((tag == V_ASN1_NEG_INTEGER) || (tag == V_ASN1_NEG_ENUMERATED))\n\t\t\t\t\t\t\ttag &= ~0x100;\n\tif(tag < 0 || tag > 30) return "(unknown)";\n\treturn tag2str[tag];\n}']