crypto/asn1/a_object.c:186: error: BUFFER_OVERRUN_L1
  Offset added: 80 Size: 37 by call to `i2t_ASN1_OBJECT`.
Showing all 8 steps of the trace


crypto/asn1/a_object.c:186:4: Call
184.   	if ((a == NULL) || (a->data == NULL))
185.   		return(BIO_write(bp,"NULL",4));
186.   	i=i2t_ASN1_OBJECT(buf,80,a);
          ^
187.   	if (i > 80) i=80;
188.   	BIO_write(bp,buf,i);

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

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

crypto/objects/obj_dat.c:433:1: <Offset trace>
431.   	}
432.   
433. > int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
434.   {
435.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:433:1: Parameter `buf_len`
    431.   	}
    432.   
    433. > int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
    434.   {
    435.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:433:1: <Length trace>
431.   	}
432.   
433. > int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
434.   {
435.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:433:1: Array declaration
    431.   	}
    432.   
    433. > int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
    434.   {
    435.   	int i,idx=0,n=0,len,nid;

crypto/objects/obj_dat.c:467:3: Array access: Offset added: 80 Size: 37 by call to `i2t_ASN1_OBJECT` 
    465.   		sprintf(tbuf,"%d.%lu",i,l);
    466.   		i=strlen(tbuf);
    467.   		strncpy(buf,tbuf,buf_len);
             ^
    468.   		buf_len-=i;
    469.   		buf+=i;

int OBJ_obj2txt(char *buf, int buf_len, const 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[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];
	if (buf_len <= 0) return(0);
	if ((a == NULL) || (a->data == NULL)) {
		buf[0]='\0';
		return(0);
	}
	if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
		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);
}
['int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)\n\t{\n\tchar buf[80];\n\tint i;\n\tif ((a == NULL) || (a->data == NULL))\n\t\treturn(BIO_write(bp,"NULL",4));\n\ti=i2t_ASN1_OBJECT(buf,80,a);\n\tif (i > 80) i=80;\n\tBIO_write(bp,buf,i);\n\treturn(i);\n\t}', '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, const 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[DECIMAL_SIZE(i)+DECIMAL_SIZE(l)+2];\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\tif (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {\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}']