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


crypto/ec/ec_ameth.c:455:18: Call
453.   		{
454.   		public_key = EC_KEY_get0_public_key(x);
455.   		if ((pub_key = EC_POINT_point2bn(group, public_key,
                        ^
456.   			EC_KEY_get_conv_form(x), NULL, ctx)) == NULL)
457.   			{

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/ec_ameth.c:462:22: Call
460.   			}
461.   		if (pub_key)
462.   			buf_len = (size_t)BN_num_bytes(pub_key);
                            ^
463.   		}
464.   

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]));
	}
['static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype)\n\t{\n\tunsigned char *buffer=NULL;\n\tconst char *ecstr;\n\tsize_t\tbuf_len=0, i;\n\tint     ret=0, reason=ERR_R_BIO_LIB;\n\tBIGNUM  *pub_key=NULL, *order=NULL;\n\tBN_CTX  *ctx=NULL;\n\tconst EC_GROUP *group;\n\tconst EC_POINT *public_key;\n\tconst BIGNUM *priv_key;\n\tif (x == NULL || (group = EC_KEY_get0_group(x)) == NULL)\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 (ktype > 0)\n\t\t{\n\t\tpublic_key = EC_KEY_get0_public_key(x);\n\t\tif ((pub_key = EC_POINT_point2bn(group, public_key,\n\t\t\tEC_KEY_get_conv_form(x), 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\tif (pub_key)\n\t\t\tbuf_len = (size_t)BN_num_bytes(pub_key);\n\t\t}\n\tif (ktype == 2)\n\t\t{\n\t\tpriv_key = EC_KEY_get0_private_key(x);\n\t\tif (priv_key && (i = (size_t)BN_num_bytes(priv_key)) > buf_len)\n\t\t\tbuf_len = i;\n\t\t}\n\telse\n\t\tpriv_key = NULL;\n\tif (ktype > 0)\n\t\t{\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\t}\n\tif (ktype == 2)\n\t\tecstr = "Private-Key";\n\telse if (ktype == 1)\n\t\tecstr = "Public-Key";\n\telse\n\t\tecstr = "ECDSA-Parameters";\n\tif (!BIO_indent(bp, off, 128))\n\t\tgoto err;\n\tif ((order = BN_new()) == NULL)\n\t\tgoto err;\n\tif (!EC_GROUP_get_order(group, order, NULL))\n\t\tgoto err;\n\tif (BIO_printf(bp, "%s: (%d bit)\\n", ecstr,\n\t\tBN_num_bits(order)) <= 0) goto err;\n\tif ((priv_key != NULL) && !ASN1_bn_print(bp, "priv:", priv_key,\n\t\tbuffer, off))\n\t\tgoto err;\n\tif ((pub_key != NULL) && !ASN1_bn_print(bp, "pub: ", pub_key,\n\t\tbuffer, off))\n\t\tgoto err;\n\tif (!ECPKParameters_print(bp, group, off))\n\t\tgoto err;\n\tret=1;\nerr:\n\tif (!ret)\n \t\tECerr(EC_F_DO_EC_KEY_PRINT, reason);\n\tif (pub_key)\n\t\tBN_free(pub_key);\n\tif (order)\n\t\tBN_free(order);\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}']