summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index 0998b41829..3e2ba29495 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.47 2021/12/03 17:01:07 jsing Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.48 2021/12/03 17:03:54 jsing 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 *
@@ -383,19 +383,16 @@ ASN1_STRING_free(ASN1_STRING *a)
383int 383int
384ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b) 384ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
385{ 385{
386 int i; 386 int cmp;
387 387
388 if (a == NULL || b == NULL) 388 if (a == NULL || b == NULL)
389 return -1; 389 return -1;
390 i = (a->length - b->length); 390 if ((cmp = (a->length - b->length)) != 0)
391 if (i == 0) { 391 return cmp;
392 i = memcmp(a->data, b->data, a->length); 392 if ((cmp = memcmp(a->data, b->data, a->length)) != 0)
393 if (i == 0) 393 return cmp;
394 return (a->type - b->type); 394
395 else 395 return (a->type - b->type);
396 return (i);
397 } else
398 return (i);
399} 396}
400 397
401void 398void