crypto/dh/dh_ameth.c:364: error: INTEGER_OVERFLOW_L2
  ([0, `x->p->top`] - 1):unsigned64 by call to `BN_num_bits`.
Showing all 7 steps of the trace


crypto/dh/dh_ameth.c:316:1: Parameter `x->p->top`
314.   	}
315.   
316. > static int do_dh_print(BIO *bp, const DH *x, int indent,
317.   						ASN1_PCTX *ctx, int ptype)
318.   	{

crypto/dh/dh_ameth.c:337:2: Call
335.   		pub_key = NULL;
336.   
337.   	update_buflen(x->p, &buf_len);
        ^
338.   
339.   	if (buf_len == 0)

crypto/dh/dh_ameth.c:289:1: Parameter `b->top`
  287.   
  288.   
  289. > static void update_buflen(const BIGNUM *b, size_t *pbuflen)
  290.   	{
  291.   	size_t i;

crypto/dh/dh_ameth.c:364:45: Call
362.   
363.   	BIO_indent(bp, indent, 128);
364.   	if (BIO_printf(bp,"%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0)
                                                   ^
365.   		goto err;
366.   	indent += 4;

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, x->p->top] - 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_dh_print(BIO *bp, const DH *x, int indent,\n\t\t\t\t\t\tASN1_PCTX *ctx, int ptype)\n\t{\n\tunsigned char *m=NULL;\n\tint reason=ERR_R_BUF_LIB,ret=0;\n\tsize_t buf_len=0;\n\tconst char *ktype = NULL;\n\tBIGNUM *priv_key, *pub_key;\n\tif (ptype == 2)\n\t\tpriv_key = x->priv_key;\n\telse\n\t\tpriv_key = NULL;\n\tif (ptype > 0)\n\t\tpub_key = x->pub_key;\n\telse\n\t\tpub_key = NULL;\n\tupdate_buflen(x->p, &buf_len);\n\tif (buf_len == 0)\n\t\t{\n\t\treason = ERR_R_PASSED_NULL_PARAMETER;\n\t\tgoto err;\n\t\t}\n\tupdate_buflen(x->g, &buf_len);\n\tupdate_buflen(pub_key, &buf_len);\n\tupdate_buflen(priv_key, &buf_len);\n\tif (ptype == 2)\n\t\tktype = "PKCS#3 DH Private-Key";\n\telse if (ptype == 1)\n\t\tktype = "PKCS#3 DH Public-Key";\n\telse\n\t\tktype = "PKCS#3 DH Parameters";\n\tm= OPENSSL_malloc(buf_len+10);\n\tif (m == NULL)\n\t\t{\n\t\treason=ERR_R_MALLOC_FAILURE;\n\t\tgoto err;\n\t\t}\n\tBIO_indent(bp, indent, 128);\n\tif (BIO_printf(bp,"%s: (%d bit)\\n", ktype, BN_num_bits(x->p)) <= 0)\n\t\tgoto err;\n\tindent += 4;\n\tif (!ASN1_bn_print(bp,"private-key:",priv_key,m,indent)) goto err;\n\tif (!ASN1_bn_print(bp,"public-key:",pub_key,m,indent)) goto err;\n\tif (!ASN1_bn_print(bp,"prime:",x->p,m,indent)) goto err;\n\tif (!ASN1_bn_print(bp,"generator:",x->g,m,indent)) goto err;\n\tif (x->length != 0)\n\t\t{\n\t\tBIO_indent(bp, indent, 128);\n\t\tif (BIO_printf(bp,"recommended-private-length: %d bits\\n",\n\t\t\t(int)x->length) <= 0) goto err;\n\t\t}\n\tret=1;\n\tif (0)\n\t\t{\nerr:\n\t\tDHerr(DH_F_DO_DH_PRINT,reason);\n\t\t}\n\tif (m != NULL) OPENSSL_free(m);\n\treturn(ret);\n\t}', 'static void update_buflen(const BIGNUM *b, size_t *pbuflen)\n\t{\n\tsize_t i;\n\tif (!b)\n\t\treturn;\n\tif (*pbuflen < (i = (size_t)BN_num_bytes(b)))\n\t\t\t*pbuflen = i;\n\t}', '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}']