diff options
author | beck <> | 2014-10-16 03:19:02 +0000 |
---|---|---|
committer | beck <> | 2014-10-16 03:19:02 +0000 |
commit | 909247b30c58e971994251b7bf7092e9dd8967df (patch) | |
tree | 7ece308937377519bc98e92f91a60254d78bd0be /src/lib/libcrypto/x509/x509_trs.c | |
parent | 2a0ad3abadc99c32f111a2f2aaa9131c0acf27cb (diff) | |
download | openbsd-909247b30c58e971994251b7bf7092e9dd8967df.tar.gz openbsd-909247b30c58e971994251b7bf7092e9dd8967df.tar.bz2 openbsd-909247b30c58e971994251b7bf7092e9dd8967df.zip |
Get rid of the last remaining BUF_strdup and BUF_strlcpy and friends, use
intrinsic functions everywhere, and wrap these functions in an
#ifndef LIBRESSL_INTERNAL to make sure we don't bring their use back.
Diffstat (limited to 'src/lib/libcrypto/x509/x509_trs.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_trs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c index 544fb5e884..d4e6be65e6 100644 --- a/src/lib/libcrypto/x509/x509_trs.c +++ b/src/lib/libcrypto/x509/x509_trs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_trs.c,v 1.16 2014/09/28 10:52:59 miod Exp $ */ | 1 | /* $OpenBSD: x509_trs.c,v 1.17 2014/10/16 03:19:02 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <string.h> | ||
60 | 61 | ||
61 | #include <openssl/err.h> | 62 | #include <openssl/err.h> |
62 | #include <openssl/x509v3.h> | 63 | #include <openssl/x509v3.h> |
@@ -202,7 +203,7 @@ X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), | |||
202 | if (trtmp->flags & X509_TRUST_DYNAMIC_NAME) | 203 | if (trtmp->flags & X509_TRUST_DYNAMIC_NAME) |
203 | free(trtmp->name); | 204 | free(trtmp->name); |
204 | /* dup supplied name */ | 205 | /* dup supplied name */ |
205 | if ((trtmp->name = BUF_strdup(name)) == NULL) | 206 | if (name == NULL || (trtmp->name = strdup(name)) == NULL) |
206 | goto err; | 207 | goto err; |
207 | /* Keep the dynamic flag of existing entry */ | 208 | /* Keep the dynamic flag of existing entry */ |
208 | trtmp->flags &= X509_TRUST_DYNAMIC; | 209 | trtmp->flags &= X509_TRUST_DYNAMIC; |