diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-04-18 15:38:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-04-18 15:38:17 +0000 |
commit | 689f87fd41f834ac86e0396b79183ce2e046bace (patch) | |
tree | e1f8e28cd2234a06b5878844efca31599cd2ce0b /lib | |
parent | 8382293ab13349ae30fef571d30c53f40e059566 (diff) |
use the portable construct around asprintf; pointed out by halex
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/apps/apps.c | 3 | ||||
-rw-r--r-- | lib/libssl/src/crypto/conf/conf_mod.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/libssl/src/apps/apps.c b/lib/libssl/src/apps/apps.c index cb9f8b0058e..446bb4d17ce 100644 --- a/lib/libssl/src/apps/apps.c +++ b/lib/libssl/src/apps/apps.c @@ -1326,7 +1326,8 @@ make_config_name() const char *t = X509_get_default_cert_area(); char *p; - asprintf(&p, "%s/openssl.cnf", t); + if (asprintf(&p, "%s/openssl.cnf", t) == -1) + return NULL; return p; } diff --git a/lib/libssl/src/crypto/conf/conf_mod.c b/lib/libssl/src/crypto/conf/conf_mod.c index 436f239b12e..24170865378 100644 --- a/lib/libssl/src/crypto/conf/conf_mod.c +++ b/lib/libssl/src/crypto/conf/conf_mod.c @@ -551,7 +551,8 @@ CONF_get1_default_config_file(void) file = getenv("OPENSSL_CONF"); if (file) return BUF_strdup(file); - asprintf(&file, "%s/openssl.cnf", X509_get_default_cert_area()); + if (asprintf(&file, "%s/openssl.cnf", X509_get_default_cert_area()) == -1) + return (NULL); return file; } |