summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects/obj_lib.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/objects/obj_lib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/libcrypto/objects/obj_lib.c b/src/lib/libcrypto/objects/obj_lib.c
index 83575c16c9..45062dbd4c 100644
--- a/src/lib/libcrypto/objects/obj_lib.c
+++ b/src/lib/libcrypto/objects/obj_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_lib.c,v 1.18 2023/07/08 12:27:51 beck Exp $ */ 1/* $OpenBSD: obj_lib.c,v 1.19 2023/08/17 09:13:01 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 *
@@ -124,11 +124,12 @@ LCRYPTO_ALIAS(OBJ_dup);
124int 124int
125OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b) 125OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
126{ 126{
127 int ret; 127 int cmp;
128 128
129 ret = (a->length - b->length); 129 if ((cmp = a->length - b->length) != 0)
130 if (ret) 130 return cmp;
131 return (ret); 131 if (a->length == 0)
132 return (memcmp(a->data, b->data, a->length)); 132 return 0;
133 return memcmp(a->data, b->data, a->length);
133} 134}
134LCRYPTO_ALIAS(OBJ_cmp); 135LCRYPTO_ALIAS(OBJ_cmp);