crypto/asn1/t_x509a.c:80: error: BUFFER_OVERRUN_L2
  Offset added: [1, 80] Size: 32 by call to `OBJ_obj2txt`.
Showing all 7 steps of the trace


crypto/asn1/t_x509a.c:80:4: Call
78.   			if(!first) BIO_puts(out, ", ");
79.   			else first = 0;
80.   			OBJ_obj2txt(oidstr, 80,
         ^
81.   				sk_ASN1_OBJECT_value(aux->trust, i), 0);
82.   			BIO_puts(out, oidstr);

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:468:3: Assignment
  466.   		i=strlen(tbuf);
  467.   		strncpy(buf,tbuf,buf_len);
  468.   		buf_len-=i;
           ^
  469.   		buf+=i;
  470.   		n+=i;

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:479:6: Array access: Offset added: [1, 80] Size: 32 by call to `OBJ_obj2txt` 
  477.   				i=strlen(tbuf);
  478.   				if (buf_len > 0)
  479.   					strncpy(buf,tbuf,buf_len);
              ^
  480.   				buf_len-=i;
  481.   				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[32];
	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 X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent)\n{\n\tchar oidstr[80], first;\n\tint i;\n\tif(!aux) return 1;\n\tif(aux->trust) {\n\t\tfirst = 1;\n\t\tBIO_printf(out, "%*sTrusted Uses:\\n%*s",\n\t\t\t\t\t\tindent, "", indent + 2, "");\n\t\tfor(i = 0; i < sk_ASN1_OBJECT_num(aux->trust); i++) {\n\t\t\tif(!first) BIO_puts(out, ", ");\n\t\t\telse first = 0;\n\t\t\tOBJ_obj2txt(oidstr, 80,\n\t\t\t\tsk_ASN1_OBJECT_value(aux->trust, i), 0);\n\t\t\tBIO_puts(out, oidstr);\n\t\t}\n\t\tBIO_puts(out, "\\n");\n\t} else BIO_printf(out, "%*sNo Trusted Uses.\\n", indent, "");\n\tif(aux->reject) {\n\t\tfirst = 1;\n\t\tBIO_printf(out, "%*sRejected Uses:\\n%*s",\n\t\t\t\t\t\tindent, "", indent + 2, "");\n\t\tfor(i = 0; i < sk_ASN1_OBJECT_num(aux->reject); i++) {\n\t\t\tif(!first) BIO_puts(out, ", ");\n\t\t\telse first = 0;\n\t\t\tOBJ_obj2txt(oidstr, 80,\n\t\t\t\tsk_ASN1_OBJECT_value(aux->reject, i), 0);\n\t\t\tBIO_puts(out, oidstr);\n\t\t}\n\t\tBIO_puts(out, "\\n");\n\t} else BIO_printf(out, "%*sNo Rejected Uses.\\n", indent, "");\n\tif(aux->alias) BIO_printf(out, "%*sAlias: %s\\n", indent, "",\n\t\t\t\t\t\t\taux->alias->data);\n\tif(aux->keyid) {\n\t\tBIO_printf(out, "%*sKey Id: ", indent, "");\n\t\tfor(i = 0; i < aux->keyid->length; i++)\n\t\t\tBIO_printf(out, "%s%02X",\n\t\t\t\ti ? ":" : "",\n\t\t\t\taux->keyid->data[i]);\n\t\tBIO_write(out,"\\n",1);\n\t}\n\treturn 1;\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[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\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}']