summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-10-31 05:03:58 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-10-31 05:03:58 +0000
commitc4e414f744f85fc5c693b4002219cf8880473f74 (patch)
tree76fd5b17badf30f3a075f9440ece778135805a89 /lib
parent8711058ca477ba8064e1c586fb2bd19e1d32722f (diff)
ec_point_to_octets: move out_len initialization up a bit
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ec/ec_convert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/ec/ec_convert.c b/lib/libcrypto/ec/ec_convert.c
index cebb02b0e70..a151850f467 100644
--- a/lib/libcrypto/ec/ec_convert.c
+++ b/lib/libcrypto/ec/ec_convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_convert.c,v 1.5 2024/10/30 20:00:13 tb Exp $ */
+/* $OpenBSD: ec_convert.c,v 1.6 2024/10/31 05:03:57 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@@ -374,11 +374,11 @@ ec_point_to_octets(const EC_GROUP *group, const EC_POINT *point, int form,
size_t len = 0;
int ret = 0;
+ *out_len = 0;
+
if (out_buf != NULL && *out_buf != NULL)
goto err;
- *out_len = 0;
-
if ((len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx)) == 0)
goto err;