From 5b4b5c93e0009c770ca852b8777c29cc9498a405 Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 24 Jun 2023 16:19:52 +0000 Subject: [PATCH] Assign and test. --- lib/libcrypto/bn/bn_sqr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/bn/bn_sqr.c b/lib/libcrypto/bn/bn_sqr.c index 5f3be22304c..56664e2e36b 100644 --- a/lib/libcrypto/bn/bn_sqr.c +++ b/lib/libcrypto/bn/bn_sqr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_sqr.c,v 1.32 2023/06/24 16:10:23 jsing Exp $ */ +/* $OpenBSD: bn_sqr.c,v 1.33 2023/06/24 16:19:52 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -284,8 +284,7 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) if (rr == NULL) goto err; - r_len = a->top * 2; - if (r_len < a->top) + if ((r_len = a->top * 2) < a->top) goto err; if (!bn_wexpand(rr, r_len)) goto err; -- 2.20.1