Many security improvements (CHATS) and a warning fix.

This commit is contained in:
Ben Laurie
2002-11-12 13:23:40 +00:00
parent 707ceb29e0
commit 9831d941ca
111 changed files with 755 additions and 480 deletions

View File

@@ -464,7 +464,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
sprintf(tbuf,"%d.%lu",i,l);
i=strlen(tbuf);
strncpy(buf,tbuf,buf_len);
BUF_strlcpy(buf,tbuf,buf_len);
buf_len-=i;
buf+=i;
n+=i;
@@ -476,7 +476,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
sprintf(tbuf,".%lu",l);
i=strlen(tbuf);
if (buf_len > 0)
strncpy(buf,tbuf,buf_len);
BUF_strlcpy(buf,tbuf,buf_len);
buf_len-=i;
buf+=i;
n+=i;
@@ -488,10 +488,9 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
s=OBJ_nid2ln(nid);
if (s == NULL)
s=OBJ_nid2sn(nid);
strncpy(buf,s,buf_len);
BUF_strlcpy(buf,s,buf_len);
n=strlen(s);
}
buf[buf_len-1]='\0';
return(n);
}