backport recent changes from the cvs head
[openssl.git] / crypto / bn / bn_gf2m.c
index 2af6540ff30fcbb5ac7051a8f1bafd004241f1b5..6a793857e1305f19a548674a2d69a4bb7abb3111 100644 (file)
@@ -1080,7 +1080,8 @@ int BN_GF2m_arr2poly(const unsigned int p[], BIGNUM *a)
        BN_zero(a);
        for (i = 0; p[i] != 0; i++)
                {
-               BN_set_bit(a, p[i]);
+               if (BN_set_bit(a, p[i]) == 0)
+                       return 0;
                }
        BN_set_bit(a, 0);
        bn_check_top(a);