diff options
| author | tb <> | 2025-12-21 09:44:45 +0000 |
|---|---|---|
| committer | tb <> | 2025-12-21 09:44:45 +0000 |
| commit | 7d8536a4ed3dd5cab592844e07c9becf575e35a9 (patch) | |
| tree | fa1baf11b7bb271fe9cd4f109d5819acf52038ef /src/lib | |
| parent | 178abdc2f97bf87bad8500c0156c5ae33260726a (diff) | |
| download | openbsd-7d8536a4ed3dd5cab592844e07c9becf575e35a9.tar.gz openbsd-7d8536a4ed3dd5cab592844e07c9becf575e35a9.tar.bz2 openbsd-7d8536a4ed3dd5cab592844e07c9becf575e35a9.zip | |
X509_NAME_ENTRY_set_data(): garbage collect unnecessary i
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/libcrypto/x509/x509name.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c index e1a1432a04..d4f133bcc9 100644 --- a/src/lib/libcrypto/x509/x509name.c +++ b/src/lib/libcrypto/x509/x509name.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509name.c,v 1.37 2025/12/21 09:34:28 tb Exp $ */ | 1 | /* $OpenBSD: x509name.c,v 1.38 2025/12/21 09:44:45 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -404,8 +404,6 @@ int | |||
| 404 | X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, | 404 | X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, |
| 405 | const unsigned char *bytes, int len) | 405 | const unsigned char *bytes, int len) |
| 406 | { | 406 | { |
| 407 | int i; | ||
| 408 | |||
| 409 | if ((ne == NULL) || ((bytes == NULL) && (len != 0))) | 407 | if ((ne == NULL) || ((bytes == NULL) && (len != 0))) |
| 410 | return (0); | 408 | return (0); |
| 411 | if ((type > 0) && (type & MBSTRING_FLAG)) | 409 | if ((type > 0) && (type & MBSTRING_FLAG)) |
| @@ -413,8 +411,7 @@ X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, | |||
| 413 | OBJ_obj2nid(ne->object)) ? 1 : 0; | 411 | OBJ_obj2nid(ne->object)) ? 1 : 0; |
| 414 | if (len < 0) | 412 | if (len < 0) |
| 415 | len = strlen((const char *)bytes); | 413 | len = strlen((const char *)bytes); |
| 416 | i = ASN1_STRING_set(ne->value, bytes, len); | 414 | if (!ASN1_STRING_set(ne->value, bytes, len)) |
| 417 | if (!i) | ||
| 418 | return (0); | 415 | return (0); |
| 419 | if (type != V_ASN1_UNDEF) | 416 | if (type != V_ASN1_UNDEF) |
| 420 | ne->value->type = type; | 417 | ne->value->type = type; |
