diff options
author | 2014-07-13 16:03:09 +0000 | |
---|---|---|
committer | 2014-07-13 16:03:09 +0000 | |
commit | 74a2cbdcfd19dacf51a0f171d05707c1b7276d9b (patch) | |
tree | 15e1064adfbd3cb00711a975bdf6d5db4ddb1889 /lib/libssl/src/apps | |
parent | tedu setlist support, superseded by the new locate dbs. (diff) | |
download | wireguard-openbsd-74a2cbdcfd19dacf51a0f171d05707c1b7276d9b.tar.xz wireguard-openbsd-74a2cbdcfd19dacf51a0f171d05707c1b7276d9b.zip |
The bell tolls for BUF_strdup - Start the migration to using
intrinsics. This is the easy ones, a few left to check one at
a time.
ok miod@ deraadt@
Diffstat (limited to 'lib/libssl/src/apps')
-rw-r--r-- | lib/libssl/src/apps/apps.c | 8 | ||||
-rw-r--r-- | lib/libssl/src/apps/ca.c | 11 | ||||
-rw-r--r-- | lib/libssl/src/apps/cms.c | 5 | ||||
-rw-r--r-- | lib/libssl/src/apps/ocsp.c | 4 |
4 files changed, 15 insertions, 13 deletions
diff --git a/lib/libssl/src/apps/apps.c b/lib/libssl/src/apps/apps.c index 84dd13339dd..fdbd436acc4 100644 --- a/lib/libssl/src/apps/apps.c +++ b/lib/libssl/src/apps/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.65 2014/07/12 17:54:31 jsing Exp $ */ +/* $OpenBSD: apps.c,v 1.66 2014/07/13 16:03:09 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -473,7 +473,7 @@ app_get_pass(BIO *err, char *arg, int keepbio) int i; if (!strncmp(arg, "pass:", 5)) - return BUF_strdup(arg + 5); + return strdup(arg + 5); if (!strncmp(arg, "env:", 4)) { tmp = getenv(arg + 4); if (!tmp) { @@ -481,7 +481,7 @@ app_get_pass(BIO *err, char *arg, int keepbio) arg + 4); return NULL; } - return BUF_strdup(tmp); + return strdup(tmp); } if (!keepbio || !pwdbio) { if (!strncmp(arg, "file:", 5)) { @@ -537,7 +537,7 @@ app_get_pass(BIO *err, char *arg, int keepbio) tmp = strchr(tpass, '\n'); if (tmp) *tmp = 0; - return BUF_strdup(tpass); + return strdup(tpass); } int diff --git a/lib/libssl/src/apps/ca.c b/lib/libssl/src/apps/ca.c index 8ebfd77f0aa..ae711a2e076 100644 --- a/lib/libssl/src/apps/ca.c +++ b/lib/libssl/src/apps/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.62 2014/07/12 17:54:31 jsing Exp $ */ +/* $OpenBSD: ca.c,v 1.63 2014/07/13 16:03:09 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1729,7 +1729,7 @@ again2: } if (BN_is_zero(serial)) - row[DB_serial] = BUF_strdup("00"); + row[DB_serial] = strdup("00"); else row[DB_serial] = BN_bn2hex(serial); if (row[DB_serial] == NULL) { @@ -2195,7 +2195,7 @@ do_revoke(X509 * x509, CA_DB * db, int type, char *value) if (!bn) goto err; if (BN_is_zero(bn)) - row[DB_serial] = BUF_strdup("00"); + row[DB_serial] = strdup("00"); else row[DB_serial] = BN_bn2hex(bn); BN_free(bn); @@ -2631,7 +2631,10 @@ unpack_revinfo(ASN1_TIME ** prevtm, int *preason, ASN1_OBJECT ** phold, ASN1_OBJECT *hold = NULL; ASN1_GENERALIZEDTIME *comp_time = NULL; - tmp = BUF_strdup(str); + if ((tmp = strdup(str)) == NULL) { + BIO_printf(bio_err, "malloc failed\n"); + goto err; + } p = strchr(tmp, ','); rtime_str = tmp; diff --git a/lib/libssl/src/apps/cms.c b/lib/libssl/src/apps/cms.c index bafbce1f5c0..91203bc7198 100644 --- a/lib/libssl/src/apps/cms.c +++ b/lib/libssl/src/apps/cms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms.c,v 1.19 2014/07/12 17:54:31 jsing Exp $ */ +/* $OpenBSD: cms.c,v 1.20 2014/07/13 16:03:09 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -747,8 +747,7 @@ argerr: secret_keyid = NULL; } if (pwri_pass) { - pwri_tmp = - (unsigned char *)BUF_strdup((char *)pwri_pass); + pwri_tmp = strdup(pwri_pass); if (!pwri_tmp) goto end; if (!CMS_add0_recipient_password(cms, -1, NID_undef, diff --git a/lib/libssl/src/apps/ocsp.c b/lib/libssl/src/apps/ocsp.c index b431a3c9fdb..9bb7da0d884 100644 --- a/lib/libssl/src/apps/ocsp.c +++ b/lib/libssl/src/apps/ocsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp.c,v 1.29 2014/07/12 19:31:21 jsing Exp $ */ +/* $OpenBSD: ocsp.c,v 1.30 2014/07/13 16:03:09 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -991,7 +991,7 @@ lookup_serial(CA_DB * db, ASN1_INTEGER * ser) OPENSSL_assert(bn); /* FIXME: should report an error at this * point and abort */ if (BN_is_zero(bn)) - itmp = BUF_strdup("00"); + itmp = strdup("00"); else itmp = BN_bn2hex(bn); row[DB_serial] = itmp; |