diff options
author | Richard Levitte <levitte@openssl.org> | 2003-12-27 14:40:17 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-12-27 14:40:17 +0000 |
commit | d420ac2c7d4ba9d99ff2c257a3ad71ecc6d876e2 (patch) | |
tree | 84414c7d794c6286588d2042f060036378311348 /crypto/objects | |
parent | b79aa47a0c8478bea62fc2bb55f99e0be172da3d (diff) |
Use BUF_strlcpy() instead of strcpy().
Use BUF_strlcat() instead of strcat().
Use BIO_snprintf() instead of sprintf().
In some cases, keep better track of buffer lengths.
This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
Diffstat (limited to 'crypto/objects')
-rw-r--r-- | crypto/objects/obj_dat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index d463c11f54..b1108568f3 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -462,7 +462,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) if (i > 2) i=2; l-=(long)(i*40); - sprintf(tbuf,"%d.%lu",i,l); + BIO_snprintf(tbuf,sizeof tbuf,"%d.%lu",i,l); i=strlen(tbuf); BUF_strlcpy(buf,tbuf,buf_len); buf_len-=i; @@ -473,7 +473,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name) for (; idx<len; idx++) { l|=p[idx]&0x7f; if (!(p[idx] & 0x80)) { - sprintf(tbuf,".%lu",l); + BIO_snprintf(tbuf,sizeof tbuf,".%lu",l); i=strlen(tbuf); if (buf_len > 0) BUF_strlcpy(buf,tbuf,buf_len); |