diff options
author | Rich Salz <rsalz@openssl.org> | 2017-06-14 20:34:37 -0400 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2017-07-05 11:32:35 +1000 |
commit | 0904e79a6e6109240d5a552f2699408b26cf63ee (patch) | |
tree | df0b4928a751b05779164cf7dd84265407bea332 /crypto/conf | |
parent | ff281ee8369350d88e8b57af139614f5683e1e8c (diff) |
Undo commit d420ac2
[extended tests]
Original text:
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>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/3701)
Diffstat (limited to 'crypto/conf')
-rw-r--r-- | crypto/conf/conf_def.c | 4 | ||||
-rw-r--r-- | crypto/conf/conf_mod.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index a7b11d1598..78acdec4f6 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -323,7 +323,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } - OPENSSL_strlcpy(v->name, pname, strlen(pname) + 1); + strcpy(v->name, pname); if (!str_copy(conf, psection, &(v->value), start)) goto err; @@ -353,7 +353,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) OPENSSL_free(section); if (line != NULL) *line = eline; - BIO_snprintf(btmp, sizeof btmp, "%ld", eline); + sprintf(btmp, "%ld", eline); ERR_add_error_data(2, "line ", btmp); if (h != conf->data) { CONF_free(conf->data); diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c index 31f838e0fa..33a96980bb 100644 --- a/crypto/conf/conf_mod.c +++ b/crypto/conf/conf_mod.c @@ -171,7 +171,7 @@ static int module_run(const CONF *cnf, const char *name, const char *value, if (!(flags & CONF_MFLAGS_SILENT)) { char rcode[DECIMAL_SIZE(ret) + 1]; CONFerr(CONF_F_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR); - BIO_snprintf(rcode, sizeof rcode, "%-8d", ret); + sprintf(rcode, "%-8d", ret); ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode); } @@ -492,11 +492,11 @@ char *CONF_get1_default_config_file(void) if (file == NULL) return NULL; - OPENSSL_strlcpy(file, X509_get_default_cert_area(), len + 1); + strcpy(file, X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS - OPENSSL_strlcat(file, "/", len + 1); + strcat(file, "/"); #endif - OPENSSL_strlcat(file, OPENSSL_CONF, len + 1); + strcat(file, OPENSSL_CONF); return file; } |