summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-10-31 05:03:57 +0000
committertb <>2024-10-31 05:03:57 +0000
commit5902169fca3f77e8990a326628063ffd24ee2db1 (patch)
tree98fceead5aac6731961d456c178d36e765307006 /src
parentfc81f42666e83d9aeb15b1b95195cc9b8e84892e (diff)
downloadopenbsd-5902169fca3f77e8990a326628063ffd24ee2db1.tar.gz
openbsd-5902169fca3f77e8990a326628063ffd24ee2db1.tar.bz2
openbsd-5902169fca3f77e8990a326628063ffd24ee2db1.zip
ec_point_to_octets: move out_len initialization up a bit
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_convert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_convert.c b/src/lib/libcrypto/ec/ec_convert.c
index cebb02b0e7..a151850f46 100644
--- a/src/lib/libcrypto/ec/ec_convert.c
+++ b/src/lib/libcrypto/ec/ec_convert.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_convert.c,v 1.5 2024/10/30 20:00:13 tb Exp $ */ 1/* $OpenBSD: ec_convert.c,v 1.6 2024/10/31 05:03:57 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -374,11 +374,11 @@ ec_point_to_octets(const EC_GROUP *group, const EC_POINT *point, int form,
374 size_t len = 0; 374 size_t len = 0;
375 int ret = 0; 375 int ret = 0;
376 376
377 *out_len = 0;
378
377 if (out_buf != NULL && *out_buf != NULL) 379 if (out_buf != NULL && *out_buf != NULL)
378 goto err; 380 goto err;
379 381
380 *out_len = 0;
381
382 if ((len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx)) == 0) 382 if ((len = EC_POINT_point2oct(group, point, form, NULL, 0, ctx)) == 0)
383 goto err; 383 goto err;
384 384