diff options
| author | beck <> | 2014-07-13 16:03:10 +0000 |
|---|---|---|
| committer | beck <> | 2014-07-13 16:03:10 +0000 |
| commit | c7e9c2c6576cd5406680f9b69aff2038ba63b0dc (patch) | |
| tree | c2bbb8405534dcf838bc686b6748045284f3966b /src/lib/libcrypto/x509v3/v3_utl.c | |
| parent | 679de7876fe8228887034f815ef2e29db63ba752 (diff) | |
| download | openbsd-c7e9c2c6576cd5406680f9b69aff2038ba63b0dc.tar.gz openbsd-c7e9c2c6576cd5406680f9b69aff2038ba63b0dc.tar.bz2 openbsd-c7e9c2c6576cd5406680f9b69aff2038ba63b0dc.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 'src/lib/libcrypto/x509v3/v3_utl.c')
| -rw-r--r-- | src/lib/libcrypto/x509v3/v3_utl.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c index d9987e32a5..99090f3cd2 100644 --- a/src/lib/libcrypto/x509v3/v3_utl.c +++ b/src/lib/libcrypto/x509v3/v3_utl.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: v3_utl.c,v 1.22 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: v3_utl.c,v 1.23 2014/07/13 16:03:10 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. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -87,9 +87,9 @@ X509V3_add_value(const char *name, const char *value, | |||
| 87 | CONF_VALUE *vtmp = NULL; | 87 | CONF_VALUE *vtmp = NULL; |
| 88 | char *tname = NULL, *tvalue = NULL; | 88 | char *tname = NULL, *tvalue = NULL; |
| 89 | 89 | ||
| 90 | if (name && !(tname = BUF_strdup(name))) | 90 | if (name && !(tname = strdup(name))) |
| 91 | goto err; | 91 | goto err; |
| 92 | if (value && !(tvalue = BUF_strdup(value))) | 92 | if (value && !(tvalue = strdup(value))) |
| 93 | goto err; | 93 | goto err; |
| 94 | if (!(vtmp = malloc(sizeof(CONF_VALUE)))) | 94 | if (!(vtmp = malloc(sizeof(CONF_VALUE)))) |
| 95 | goto err; | 95 | goto err; |
| @@ -301,7 +301,10 @@ X509V3_parse_list(const char *line) | |||
| 301 | int state; | 301 | int state; |
| 302 | 302 | ||
| 303 | /* We are going to modify the line so copy it first */ | 303 | /* We are going to modify the line so copy it first */ |
| 304 | linebuf = BUF_strdup(line); | 304 | if ((linebuf = strdup(line)) == NULL) { |
| 305 | X509V3err(X509V3_F_X509V3_PARSE_LIST, ERR_R_MALLOC_FAILURE); | ||
| 306 | goto err; | ||
| 307 | } | ||
| 305 | state = HDR_NAME; | 308 | state = HDR_NAME; |
| 306 | ntmp = NULL; | 309 | ntmp = NULL; |
| 307 | 310 | ||
| @@ -632,7 +635,7 @@ append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) | |||
| 632 | /* Don't add duplicates */ | 635 | /* Don't add duplicates */ |
| 633 | if (sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1) | 636 | if (sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1) |
| 634 | return 1; | 637 | return 1; |
| 635 | emtmp = BUF_strdup((char *)email->data); | 638 | emtmp = strdup((char *)email->data); |
| 636 | if (!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { | 639 | if (!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { |
| 637 | X509_email_free(*sk); | 640 | X509_email_free(*sk); |
| 638 | *sk = NULL; | 641 | *sk = NULL; |
| @@ -686,7 +689,7 @@ a2i_IPADDRESS_NC(const char *ipasc) | |||
| 686 | p = strchr(ipasc, '/'); | 689 | p = strchr(ipasc, '/'); |
| 687 | if (!p) | 690 | if (!p) |
| 688 | return NULL; | 691 | return NULL; |
| 689 | iptmp = BUF_strdup(ipasc); | 692 | iptmp = strdup(ipasc); |
| 690 | if (!iptmp) | 693 | if (!iptmp) |
| 691 | return NULL; | 694 | return NULL; |
| 692 | p = iptmp + (p - ipasc); | 695 | p = iptmp + (p - ipasc); |
