Add bn_dup_expand() comment from the main branch explaining that
[oweals/openssl.git] / crypto / bn / bn_lib.c
index a016cb7f5379776658357367bd86d5383e297392..8abe095af28e3797f72a8230fd5b82183cb6f44b 100644 (file)
@@ -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);