crypto/x509v3/v3_info.c:96: error: BUFFER_OVERRUN_L2
  Offset added: [1, 80] Size: 32 by call to `i2t_ASN1_OBJECT`.
Showing all 9 steps of the trace


crypto/x509v3/v3_info.c:96:3: Call
94.   		if(!ret) break;
95.   		vtmp = sk_CONF_VALUE_value(ret, i);
96.   		i2t_ASN1_OBJECT(objtmp, 80, desc->method);
        ^
97.   		ntmp = Malloc(strlen(objtmp) + strlen(vtmp->name) + 5);
98.   		if(!ntmp) {

crypto/asn1/a_object.c:173:1: Parameter `buf_len`
  171.   	}
  172.   
  173. > int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
  174.   {
  175.   	return OBJ_obj2txt(buf, buf_len, a, 0);

crypto/asn1/a_object.c:175:9: Call
  173.   int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)
  174.   {
  175.   	return OBJ_obj2txt(buf, buf_len, a, 0);
                 ^
  176.   }
  177.   

crypto/objects/obj_dat.c:421:1: <Offset trace>
419.   	}
420.   
421. > int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
422.   {
423.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:421:1: Parameter `buf_len`
    419.   	}
    420.   
    421. > int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
    422.   {
    423.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:457:3: Assignment
    455.   		i=strlen(tbuf);
    456.   		strncpy(buf,tbuf,buf_len);
    457.   		buf_len-=i;
             ^
    458.   		buf+=i;
    459.   		n+=i;

crypto/objects/obj_dat.c:421:1: <Length trace>
419.   	}
420.   
421. > int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
422.   {
423.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:421:1: Array declaration
    419.   	}
    420.   
    421. > int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
    422.   {
    423.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:468:6: Array access: Offset added: [1, 80] Size: 32 by call to `i2t_ASN1_OBJECT` 
    466.   				i=strlen(tbuf);
    467.   				if (buf_len > 0)
    468.   					strncpy(buf,tbuf,buf_len);
                ^
    469.   				buf_len-=i;
    470.   				buf+=i;

int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)
{
	int i,idx=0,n=0,len,nid;
	unsigned long l;
	unsigned char *p;
	const char *s;
	char tbuf[32];
	if (buf_len <= 0) return(0);
	if ((a == NULL) || (a->data == NULL)) {
		buf[0]='\0';
		return(0);
	}
	nid=OBJ_obj2nid(a);
	if ((nid == NID_undef) || no_name) {
		len=a->length;
		p=a->data;
		idx=0;
		l=0;
		while (idx < a->length) {
			l|=(p[idx]&0x7f);
			if (!(p[idx] & 0x80)) break;
			l<<=7L;
			idx++;
		}
		idx++;
		i=(int)(l/40);
		if (i > 2) i=2;
		l-=(long)(i*40);
		sprintf(tbuf,"%d.%lu",i,l);
		i=strlen(tbuf);
		strncpy(buf,tbuf,buf_len);
		buf_len-=i;
		buf+=i;
		n+=i;
		l=0;
		for (; idx<len; idx++) {
			l|=p[idx]&0x7f;
			if (!(p[idx] & 0x80)) {
				sprintf(tbuf,".%lu",l);
				i=strlen(tbuf);
				if (buf_len > 0)
					strncpy(buf,tbuf,buf_len);
				buf_len-=i;
				buf+=i;
				n+=i;
				l=0;
			}
			l<<=7L;
		}
	} else {
		s=OBJ_nid2ln(nid);
		if (s == NULL)
			s=OBJ_nid2sn(nid);
		strncpy(buf,s,buf_len);
		n=strlen(s);
	}
	buf[buf_len-1]='\0';
	return(n);
}
['static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,\n\t\t\t\tSTACK_OF(ACCESS_DESCRIPTION) *ainfo,\n\t\t\t\t\t\tSTACK_OF(CONF_VALUE) *ret)\n{\n\tACCESS_DESCRIPTION *desc;\n\tint i;\n\tchar objtmp[80], *ntmp;\n\tCONF_VALUE *vtmp;\n\tfor(i = 0; i < sk_ACCESS_DESCRIPTION_num(ainfo); i++) {\n\t\tdesc = sk_ACCESS_DESCRIPTION_value(ainfo, i);\n\t\tret = i2v_GENERAL_NAME(method, desc->location, ret);\n\t\tif(!ret) break;\n\t\tvtmp = sk_CONF_VALUE_value(ret, i);\n\t\ti2t_ASN1_OBJECT(objtmp, 80, desc->method);\n\t\tntmp = Malloc(strlen(objtmp) + strlen(vtmp->name) + 5);\n\t\tif(!ntmp) {\n\t\t\tX509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS,\n\t\t\t\t\tERR_R_MALLOC_FAILURE);\n\t\t\treturn NULL;\n\t\t}\n\t\tstrcpy(ntmp, objtmp);\n\t\tstrcat(ntmp, " - ");\n\t\tstrcat(ntmp, vtmp->name);\n\t\tFree(vtmp->name);\n\t\tvtmp->name = ntmp;\n\t}\n\tif(!ret) return sk_CONF_VALUE_new_null();\n\treturn ret;\n}', 'int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a)\n{\n\treturn OBJ_obj2txt(buf, buf_len, a, 0);\n}', 'int OBJ_obj2txt(char *buf, int buf_len, ASN1_OBJECT *a, int no_name)\n{\n\tint i,idx=0,n=0,len,nid;\n\tunsigned long l;\n\tunsigned char *p;\n\tconst char *s;\n\tchar tbuf[32];\n\tif (buf_len <= 0) return(0);\n\tif ((a == NULL) || (a->data == NULL)) {\n\t\tbuf[0]=\'\\0\';\n\t\treturn(0);\n\t}\n\tnid=OBJ_obj2nid(a);\n\tif ((nid == NID_undef) || no_name) {\n\t\tlen=a->length;\n\t\tp=a->data;\n\t\tidx=0;\n\t\tl=0;\n\t\twhile (idx < a->length) {\n\t\t\tl|=(p[idx]&0x7f);\n\t\t\tif (!(p[idx] & 0x80)) break;\n\t\t\tl<<=7L;\n\t\t\tidx++;\n\t\t}\n\t\tidx++;\n\t\ti=(int)(l/40);\n\t\tif (i > 2) i=2;\n\t\tl-=(long)(i*40);\n\t\tsprintf(tbuf,"%d.%lu",i,l);\n\t\ti=strlen(tbuf);\n\t\tstrncpy(buf,tbuf,buf_len);\n\t\tbuf_len-=i;\n\t\tbuf+=i;\n\t\tn+=i;\n\t\tl=0;\n\t\tfor (; idx<len; idx++) {\n\t\t\tl|=p[idx]&0x7f;\n\t\t\tif (!(p[idx] & 0x80)) {\n\t\t\t\tsprintf(tbuf,".%lu",l);\n\t\t\t\ti=strlen(tbuf);\n\t\t\t\tif (buf_len > 0)\n\t\t\t\t\tstrncpy(buf,tbuf,buf_len);\n\t\t\t\tbuf_len-=i;\n\t\t\t\tbuf+=i;\n\t\t\t\tn+=i;\n\t\t\t\tl=0;\n\t\t\t}\n\t\t\tl<<=7L;\n\t\t}\n\t} else {\n\t\ts=OBJ_nid2ln(nid);\n\t\tif (s == NULL)\n\t\t\ts=OBJ_nid2sn(nid);\n\t\tstrncpy(buf,s,buf_len);\n\t\tn=strlen(s);\n\t}\n\tbuf[buf_len-1]=\'\\0\';\n\treturn(n);\n}']