New err_code.pl script to retain old error codes. This should allow the use
[oweals/openssl.git] / crypto / bn / bn_mont.c
index e0aa3c769d227dc5f58e9052627b6edb070819d4..2215dc3589c104dc51e8ed7e26cf200b13e27d07 100644 (file)
@@ -235,7 +235,7 @@ printf("number BN_from_montgomery\n");
                /* hmm... if a is between i and 2*i, things are bad */
                if (a->top > i)
                        {
-                       j=bn_add_words(ret->d,ret->d,&(a->d[i]),i);
+                       j=(int)(bn_add_words(ret->d,ret->d,&(a->d[i]),i));
                        if (j) /* overflow */
                                bn_sub_words(ret->d,ret->d,mont->N.d,i);
                        }
@@ -289,6 +289,9 @@ BN_MONT_CTX *ctx;
 void BN_MONT_CTX_free(mont)
 BN_MONT_CTX *mont;
        {
+       if(mont == NULL)
+           return;
+
        BN_free(&(mont->RR));
        BN_free(&(mont->N));
        BN_free(&(mont->Ni));