crypto/bn/bn_gf2m.c:905: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqrt_arr`.
Showing all 6 steps of the trace


crypto/bn/bn_gf2m.c:899:8: Call
897.   	bn_check_top(p);
898.   	if ((arr = (unsigned int *)OPENSSL_malloc(sizeof(unsigned int) * max)) == NULL) goto err;
899.   	ret = BN_GF2m_poly2arr(p, arr, max);
              ^
900.   	if (!ret || ret > max)
901.   		{

crypto/bn/bn_gf2m.c:1030:1: Parameter `*p`
  1028.    * number of coefficients that would be extracted if array was large enough.
  1029.    */
  1030. > int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max)
  1031.   	{
  1032.   	int i, j, k = 0;

crypto/bn/bn_gf2m.c:905:8: Call
903.   		goto err;
904.   		}
905.   	ret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx);
              ^
906.   	bn_check_top(r);
907.   err:

crypto/bn/bn_gf2m.c:860:1: <LHS trace>
858.    * Uses exponentiation as in algorithm A.4.1 from IEEE P1363.
859.    */
860. > int	BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[], BN_CTX *ctx)
861.   	{
862.   	int ret = 0;

crypto/bn/bn_gf2m.c:860:1: Parameter `*p`
  858.    * Uses exponentiation as in algorithm A.4.1 from IEEE P1363.
  859.    */
  860. > int	BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[], BN_CTX *ctx)
  861.   	{
  862.   	int ret = 0;

crypto/bn/bn_gf2m.c:875:7: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqrt_arr` 
  873.   	
  874.   	if (!BN_zero(u)) goto err;
  875.   	if (!BN_set_bit(u, p[0] - 1)) goto err;
               ^
  876.   	ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
  877.   	bn_check_top(r);

int	BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[], BN_CTX *ctx)
	{
	int ret = 0;
	BIGNUM *u;
	bn_check_top(a);
	if (!p[0])
		return BN_zero(r);
	BN_CTX_start(ctx);
	if ((u = BN_CTX_get(ctx)) == NULL) goto err;
	if (!BN_zero(u)) goto err;
	if (!BN_set_bit(u, p[0] - 1)) goto err;
	ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
	bn_check_top(r);
err:
	BN_CTX_end(ctx);
	return ret;
	}
['int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)\n\t{\n\tint ret = 0;\n\tconst int max = BN_num_bits(p);\n\tunsigned int *arr=NULL;\n\tbn_check_top(a);\n\tbn_check_top(p);\n\tif ((arr = (unsigned int *)OPENSSL_malloc(sizeof(unsigned int) * max)) == NULL) goto err;\n\tret = BN_GF2m_poly2arr(p, arr, max);\n\tif (!ret || ret > max)\n\t\t{\n\t\tBNerr(BN_F_BN_GF2M_MOD_EXP,BN_R_INVALID_LENGTH);\n\t\tgoto err;\n\t\t}\n\tret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx);\n\tbn_check_top(r);\nerr:\n\tif (arr) OPENSSL_free(arr);\n\treturn ret;\n\t}', 'int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max)\n\t{\n\tint i, j, k = 0;\n\tBN_ULONG mask;\n\tif (BN_is_zero(a) || !BN_is_bit_set(a, 0))\n\t\treturn 0;\n\tfor (i = a->top - 1; i >= 0; i--)\n\t\t{\n\t\tif (!a->d[i])\n\t\t\tcontinue;\n\t\tmask = BN_TBIT;\n\t\tfor (j = BN_BITS2 - 1; j >= 0; j--)\n\t\t\t{\n\t\t\tif (a->d[i] & mask)\n\t\t\t\t{\n\t\t\t\tif (k < max) p[k] = BN_BITS2 * i + j;\n\t\t\t\tk++;\n\t\t\t\t}\n\t\t\tmask >>= 1;\n\t\t\t}\n\t\t}\n\treturn k;\n\t}', 'int\tBN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[], BN_CTX *ctx)\n\t{\n\tint ret = 0;\n\tBIGNUM *u;\n\tbn_check_top(a);\n\tif (!p[0])\n\t\treturn BN_zero(r);\n\tBN_CTX_start(ctx);\n\tif ((u = BN_CTX_get(ctx)) == NULL) goto err;\n\tif (!BN_zero(u)) goto err;\n\tif (!BN_set_bit(u, p[0] - 1)) goto err;\n\tret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);\n\tbn_check_top(r);\nerr:\n\tBN_CTX_end(ctx);\n\treturn ret;\n\t}']