crypto/ec/eck_prn.c:249: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned64 by call to `BN_num_bits`.
Showing all 6 steps of the trace


crypto/ec/eck_prn.c:242:14: Call
240.   		form = EC_GROUP_get_point_conversion_form(x);
241.   
242.   		if ((gen = EC_POINT_point2bn(x, point, 
                    ^
243.   				form, NULL, ctx)) == NULL)
244.   			{

crypto/ec/ec_print.c:59:1: Parameter `ret->top`
  57.   #include "ec_lcl.h"
  58.   
  59. > BIGNUM *EC_POINT_point2bn(const EC_GROUP *group, 
  60.                             const EC_POINT *point, 
  61.                             point_conversion_form_t form,

crypto/ec/eck_prn.c:249:21: Call
247.   			}
248.   
249.   		buf_len = (size_t)BN_num_bytes(p);
                           ^
250.   		if (buf_len < (i = (size_t)BN_num_bytes(a)))
251.   			buf_len = i;

crypto/bn/bn_lib.c:248:1: <LHS trace>
246.   	}
247.   
248. > int BN_num_bits(const BIGNUM *a)
249.   	{
250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:248:1: Parameter `a->top`
  246.   	}
  247.   
  248. > int BN_num_bits(const BIGNUM *a)
  249.   	{
  250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:250:2: Binary operation: ([0, +oo] - 1):unsigned64 by call to `BN_num_bits` 
  248.   int BN_num_bits(const BIGNUM *a)
  249.   	{
  250.   	int i = a->top - 1;
          ^
  251.   	bn_check_top(a);
  252.   

int BN_num_bits(const BIGNUM *a)
	{
	int i = a->top - 1;
	bn_check_top(a);
	if (BN_is_zero(a)) return 0;
	return ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));
	}
['int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)\n\t{\n\tunsigned char *buffer=NULL;\n\tsize_t\tbuf_len=0, i;\n\tint     ret=0, reason=ERR_R_BIO_LIB;\n\tBN_CTX  *ctx=NULL;\n\tconst EC_POINT *point=NULL;\n\tBIGNUM\t*p=NULL, *a=NULL, *b=NULL, *gen=NULL,\n\t\t*order=NULL, *cofactor=NULL;\n\tconst unsigned char *seed;\n\tsize_t\tseed_len=0;\n\tstatic const char *gen_compressed = "Generator (compressed):";\n\tstatic const char *gen_uncompressed = "Generator (uncompressed):";\n\tstatic const char *gen_hybrid = "Generator (hybrid):";\n\tif (!x)\n\t\t{\n\t\treason = ERR_R_PASSED_NULL_PARAMETER;\n\t\tgoto err;\n\t\t}\n\tctx = BN_CTX_new();\n\tif (ctx == NULL)\n\t\t{\n\t\treason = ERR_R_MALLOC_FAILURE;\n\t\tgoto err;\n\t\t}\n\tif (EC_GROUP_get_asn1_flag(x))\n\t\t{\n\t\tint nid;\n\t\tif (!BIO_indent(bp, off, 128))\n\t\t\tgoto err;\n\t\tnid = EC_GROUP_get_curve_name(x);\n\t\tif (nid == 0)\n\t\t\tgoto err;\n\t\tif (BIO_printf(bp, "ASN1 OID: %s", OBJ_nid2sn(nid)) <= 0)\n\t\t\tgoto err;\n\t\tif (BIO_printf(bp, "\\n") <= 0)\n\t\t\tgoto err;\n\t\t}\n\telse\n\t\t{\n\t\tint is_char_two = 0;\n\t\tpoint_conversion_form_t form;\n\t\tint tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(x));\n\t\tif (tmp_nid == NID_X9_62_characteristic_two_field)\n\t\t\tis_char_two = 1;\n\t\tif ((p = BN_new()) == NULL || (a = BN_new()) == NULL ||\n\t\t\t(b = BN_new()) == NULL || (order = BN_new()) == NULL ||\n\t\t\t(cofactor = BN_new()) == NULL)\n\t\t\t{\n\t\t\treason = ERR_R_MALLOC_FAILURE;\n\t\t\tgoto err;\n\t\t\t}\n\t\tif (is_char_two)\n\t\t\t{\n\t\t\tif (!EC_GROUP_get_curve_GF2m(x, p, a, b, ctx))\n\t\t\t\t{\n\t\t\t\treason = ERR_R_EC_LIB;\n\t\t\t\tgoto err;\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (!EC_GROUP_get_curve_GFp(x, p, a, b, ctx))\n\t\t\t\t{\n\t\t\t\treason = ERR_R_EC_LIB;\n\t\t\t\tgoto err;\n\t\t\t\t}\n\t\t\t}\n\t\tif ((point = EC_GROUP_get0_generator(x)) == NULL)\n\t\t\t{\n\t\t\treason = ERR_R_EC_LIB;\n\t\t\tgoto err;\n\t\t\t}\n\t\tif (!EC_GROUP_get_order(x, order, NULL) ||\n            \t\t!EC_GROUP_get_cofactor(x, cofactor, NULL))\n\t\t\t{\n\t\t\treason = ERR_R_EC_LIB;\n\t\t\tgoto err;\n\t\t\t}\n\t\tform = EC_GROUP_get_point_conversion_form(x);\n\t\tif ((gen = EC_POINT_point2bn(x, point,\n\t\t\t\tform, NULL, ctx)) == NULL)\n\t\t\t{\n\t\t\treason = ERR_R_EC_LIB;\n\t\t\tgoto err;\n\t\t\t}\n\t\tbuf_len = (size_t)BN_num_bytes(p);\n\t\tif (buf_len < (i = (size_t)BN_num_bytes(a)))\n\t\t\tbuf_len = i;\n\t\tif (buf_len < (i = (size_t)BN_num_bytes(b)))\n\t\t\tbuf_len = i;\n\t\tif (buf_len < (i = (size_t)BN_num_bytes(gen)))\n\t\t\tbuf_len = i;\n\t\tif (buf_len < (i = (size_t)BN_num_bytes(order)))\n\t\t\tbuf_len = i;\n\t\tif (buf_len < (i = (size_t)BN_num_bytes(cofactor)))\n\t\t\tbuf_len = i;\n\t\tif ((seed = EC_GROUP_get0_seed(x)) != NULL)\n\t\t\tseed_len = EC_GROUP_get_seed_len(x);\n\t\tbuf_len += 10;\n\t\tif ((buffer = OPENSSL_malloc(buf_len)) == NULL)\n\t\t\t{\n\t\t\treason = ERR_R_MALLOC_FAILURE;\n\t\t\tgoto err;\n\t\t\t}\n\t\tif (!BIO_indent(bp, off, 128))\n\t\t\tgoto err;\n\t\tif (BIO_printf(bp, "Field Type: %s\\n", OBJ_nid2sn(tmp_nid))\n\t\t\t<= 0)\n\t\t\tgoto err;\n\t\tif (is_char_two)\n\t\t\t{\n\t\t\tint basis_type = EC_GROUP_get_basis_type(x);\n\t\t\tif (basis_type == 0)\n\t\t\t\tgoto err;\n\t\t\tif (!BIO_indent(bp, off, 128))\n\t\t\t\tgoto err;\n\t\t\tif (BIO_printf(bp, "Basis Type: %s\\n",\n\t\t\t\tOBJ_nid2sn(basis_type)) <= 0)\n\t\t\t\tgoto err;\n\t\t\tif ((p != NULL) && !ASN1_bn_print(bp, "Polynomial:", p, buffer,\n\t\t\t\toff))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif ((p != NULL) && !ASN1_bn_print(bp, "Prime:", p, buffer,off))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\tif ((a != NULL) && !ASN1_bn_print(bp, "A:   ", a, buffer, off))\n\t\t\tgoto err;\n\t\tif ((b != NULL) && !ASN1_bn_print(bp, "B:   ", b, buffer, off))\n\t\t\tgoto err;\n\t\tif (form == POINT_CONVERSION_COMPRESSED)\n\t\t\t{\n\t\t\tif ((gen != NULL) && !ASN1_bn_print(bp, gen_compressed, gen,\n\t\t\t\tbuffer, off))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\telse if (form == POINT_CONVERSION_UNCOMPRESSED)\n\t\t\t{\n\t\t\tif ((gen != NULL) && !ASN1_bn_print(bp, gen_uncompressed, gen,\n\t\t\t\tbuffer, off))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif ((gen != NULL) && !ASN1_bn_print(bp, gen_hybrid, gen,\n\t\t\t\tbuffer, off))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\tif ((order != NULL) && !ASN1_bn_print(bp, "Order: ", order,\n\t\t\tbuffer, off)) goto err;\n\t\tif ((cofactor != NULL) && !ASN1_bn_print(bp, "Cofactor: ", cofactor,\n\t\t\tbuffer, off)) goto err;\n\t\tif (seed && !print_bin(bp, "Seed:", seed, seed_len, off))\n\t\t\tgoto err;\n\t\t}\n\tret=1;\nerr:\n\tif (!ret)\n \t\tECerr(EC_F_ECPKPARAMETERS_PRINT, reason);\n\tif (p)\n\t\tBN_free(p);\n\tif (a)\n\t\tBN_free(a);\n\tif (b)\n\t\tBN_free(b);\n\tif (gen)\n\t\tBN_free(gen);\n\tif (order)\n\t\tBN_free(order);\n\tif (cofactor)\n\t\tBN_free(cofactor);\n\tif (ctx)\n\t\tBN_CTX_free(ctx);\n\tif (buffer != NULL)\n\t\tOPENSSL_free(buffer);\n\treturn(ret);\n\t}', 'BIGNUM *EC_POINT_point2bn(const EC_GROUP *group,\n                          const EC_POINT *point,\n                          point_conversion_form_t form,\n                          BIGNUM *ret,\n                          BN_CTX *ctx)\n\t{\n\tsize_t        buf_len=0;\n\tunsigned char *buf;\n\tbuf_len = EC_POINT_point2oct(group, point, form,\n                                     NULL, 0, ctx);\n\tif (buf_len == 0)\n\t\treturn NULL;\n\tif ((buf = OPENSSL_malloc(buf_len)) == NULL)\n\t\treturn NULL;\n\tif (!EC_POINT_point2oct(group, point, form, buf, buf_len, ctx))\n\t\t{\n\t\tOPENSSL_free(buf);\n\t\treturn NULL;\n\t\t}\n\tret = BN_bin2bn(buf, buf_len, ret);\n\tOPENSSL_free(buf);\n\treturn ret;\n}', 'int BN_num_bits(const BIGNUM *a)\n\t{\n\tint i = a->top - 1;\n\tbn_check_top(a);\n\tif (BN_is_zero(a)) return 0;\n\treturn ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));\n\t}']