crypto/bn/bn_gf2m.c:858: 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:853:6: Call
851.   	unsigned int *arr=NULL, ret = 0;
852.   	if ((arr = (unsigned int *)OPENSSL_malloc(sizeof(unsigned int) * max)) == NULL) goto err;
853.   	if (BN_GF2m_poly2arr(p, arr, max) > max)
            ^
854.   		{
855.   		BNerr(BN_F_BN_GF2M_MOD_EXP,BN_R_INVALID_LENGTH);

crypto/bn/bn_gf2m.c:971:1: Parameter `*p`
  969.    * number of coefficients that would be extracted if array was large enough.
  970.    */
  971. > int BN_GF2m_poly2arr(const BIGNUM *a, unsigned int p[], int max)
  972.   	{
  973.   	int i, j, k;

crypto/bn/bn_gf2m.c:858:8: Call
856.   		goto err;
857.   		}
858.   	ret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx);
              ^
859.   	bn_check_top(r);
860.     err:

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

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

crypto/bn/bn_gf2m.c:832:7: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqrt_arr` 
  830.   	
  831.   	if (!BN_zero(u)) goto err;
  832.   	if (!BN_set_bit(u, p[0] - 1)) goto err;
               ^
  833.   	ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
  834.   	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_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\tconst int max = BN_num_bits(p);\n\tunsigned int *arr=NULL, ret = 0;\n\tif ((arr = (unsigned int *)OPENSSL_malloc(sizeof(unsigned int) * max)) == NULL) goto err;\n\tif (BN_GF2m_poly2arr(p, arr, max) > 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);\n  err:\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;\n\tBN_ULONG mask;\n\tfor (k = 0; k < max; k++) p[k] = 0;\n\tk = 0;\n\tfor (i = a->top - 1; i >= 0; i--)\n\t\t{\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_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);\n  err:\n\tBN_CTX_end(ctx);\n\treturn ret;\n\t}']