From 6178bb8fe9a1754aa34c2c8c62f6c85edd64b872 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bodo=20M=C3=B6ller?= Date: Thu, 25 Jul 2002 12:14:41 +0000 Subject: [PATCH] Add bn_dup_expand() comment from the main branch explaining that bn_dup_expand() is broken. [No need to fix this in 0.9.7-stable, it is just an unused internal function.] --- crypto/bn/bn_lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index a016cb7f53..8abe095af2 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -397,6 +397,12 @@ BIGNUM *bn_dup_expand(const BIGNUM *b, int words) { BIGNUM *r = NULL; + /* This function does not work if + * words <= b->dmax && top < words + * because BN_dup() does not preserve 'dmax'! + * (But bn_dup_expand() is not used anywhere yet.) + */ + if (words > b->dmax) { BN_ULONG *a = bn_expand_internal(b, words); -- 2.25.1