diff options
author | Richard Levitte <levitte@openssl.org> | 2003-12-27 15:40:17 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-12-27 15:40:17 +0100 |
commit | d420ac2c7d4ba9d99ff2c257a3ad71ecc6d876e2 (patch) | |
tree | 84414c7d794c6286588d2042f060036378311348 /crypto/conf/conf_def.c | |
parent | Add a newline at the end of the last line. (diff) | |
download | openssl-d420ac2c7d4ba9d99ff2c257a3ad71ecc6d876e2.tar.xz openssl-d420ac2c7d4ba9d99ff2c257a3ad71ecc6d876e2.zip |
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/conf/conf_def.c')
-rw-r--r-- | crypto/conf/conf_def.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 52a87aa76c..0451be0153 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -235,7 +235,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE); goto err; } - strcpy(section,"default"); + BUF_strlcpy(section,"default",10); if (_CONF_new_data(conf) == 0) { @@ -392,7 +392,7 @@ again: ERR_R_MALLOC_FAILURE); goto err; } - strcpy(v->name,pname); + BUF_strlcpy(v->name,pname,strlen(pname)+1); if (!str_copy(conf,psection,&(v->value),start)) goto err; if (strcmp(psection,section) != 0) @@ -447,7 +447,7 @@ err: if (buff != NULL) BUF_MEM_free(buff); if (section != NULL) OPENSSL_free(section); if (line != NULL) *line=eline; - sprintf(btmp,"%ld",eline); + BIO_snprintf(btmp,sizeof btmp,"%ld",eline); ERR_add_error_data(2,"line ",btmp); if ((h != conf->data) && (conf->data != NULL)) { |