summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2023-06-24 16:19:52 +0000
committerjsing <>2023-06-24 16:19:52 +0000
commit83f48b75515222b3e27dc71507e77779306f1629 (patch)
treecf341da2062d5a135796718e98536f2a381835a1 /src
parent14594075895390dd7aac69fd2c11f65ca275ad4e (diff)
downloadopenbsd-83f48b75515222b3e27dc71507e77779306f1629.tar.gz
openbsd-83f48b75515222b3e27dc71507e77779306f1629.tar.bz2
openbsd-83f48b75515222b3e27dc71507e77779306f1629.zip
Assign and test.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_sqr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c
index 5f3be22304..56664e2e36 100644
--- a/src/lib/libcrypto/bn/bn_sqr.c
+++ b/src/lib/libcrypto/bn/bn_sqr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqr.c,v 1.32 2023/06/24 16:10:23 jsing Exp $ */ 1/* $OpenBSD: bn_sqr.c,v 1.33 2023/06/24 16:19:52 jsing 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 *
@@ -284,8 +284,7 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
284 if (rr == NULL) 284 if (rr == NULL)
285 goto err; 285 goto err;
286 286
287 r_len = a->top * 2; 287 if ((r_len = a->top * 2) < a->top)
288 if (r_len < a->top)
289 goto err; 288 goto err;
290 if (!bn_wexpand(rr, r_len)) 289 if (!bn_wexpand(rr, r_len))
291 goto err; 290 goto err;