From 305f87561d1561ee9842b1f05b45b7bd5ddabaf3 Mon Sep 17 00:00:00 2001 From: John Bland Date: Mon, 25 Mar 2024 11:48:43 -0400 Subject: [PATCH] break out of loop on failure instead of return --- wolfcrypt/src/asn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index ce5a4f8f0..23bf29ae7 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -26018,9 +26018,8 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen) #else keyInt = GetRsaInt(key, i); ret = mp_unsigned_bin_size(keyInt); - if (ret < 0) { - return ret; - } + if (ret < 0) + break; ret = 0; /* This won't overrun output due to the outLen check above */ mpSz = SetASNIntMP(keyInt, MAX_RSA_INT_SZ, output + j);