diff options
-rw-r--r-- | src/lib/libcrypto/bn/bn_sqr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c index 56664e2e36..5ea1bd45b9 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.33 2023/06/24 16:19:52 jsing Exp $ */ | 1 | /* $OpenBSD: bn_sqr.c,v 1.34 2023/06/24 17:06:54 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 | * |
@@ -214,7 +214,9 @@ bn_sqr_normal(BN_ULONG *r, int r_len, const BN_ULONG *a, int a_len, | |||
214 | 214 | ||
215 | /* Compute initial product - r[n:1] = a[n:1] * a[0] */ | 215 | /* Compute initial product - r[n:1] = a[n:1] * a[0] */ |
216 | n = a_len - 1; | 216 | n = a_len - 1; |
217 | rp[n] = bn_mul_words(rp, ap, n, w); | 217 | if (n > 0) { |
218 | rp[n] = bn_mul_words(rp, ap, n, w); | ||
219 | } | ||
218 | rp += 2; | 220 | rp += 2; |
219 | n--; | 221 | n--; |
220 | 222 | ||