crypto/asn1/x_bignum.c:121: error: INTEGER_OVERFLOW_L2
  ([0, max(0, `(*pval)->top`)] - 1):unsigned64 by call to `BN_bn2bin`.
Showing all 9 steps of the trace


crypto/asn1/x_bignum.c:110:1: Parameter `(*pval)->top`
108.   }
109.   
110. > static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it)
111.   {
112.   	BIGNUM *bn;

crypto/asn1/x_bignum.c:117:5: Call
115.   	bn = (BIGNUM *)*pval;
116.   	/* If MSB set in an octet we need a padding byte */
117.   	if(BN_num_bits(bn) & 0x7) pad = 0;
           ^
118.   	else pad = 1;
119.   	if(cont) {

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/asn1/x_bignum.c:121:3: Call
119.   	if(cont) {
120.   		if(pad) *cont++ = 0;
121.   		BN_bn2bin(bn, cont);
         ^
122.   	}
123.   	return pad + BN_num_bytes(bn);

crypto/bn/bn_lib.c:641:1: Parameter `a->top`
  639.   
  640.   /* ignore negative */
  641. > int BN_bn2bin(const BIGNUM *a, unsigned char *to)
  642.   	{
  643.   	int n,i;

crypto/bn/bn_lib.c:647:6: Call
  645.   
  646.   	bn_check_top(a);
  647.   	n=i=BN_num_bytes(a);
              ^
  648.   	while (i--)
  649.   		{

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, max(0, (*pval)->top)] - 1):unsigned64 by call to `BN_bn2bin` 
    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 bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it)\n{\n\tBIGNUM *bn;\n\tint pad;\n\tif(!*pval) return -1;\n\tbn = (BIGNUM *)*pval;\n\tif(BN_num_bits(bn) & 0x7) pad = 0;\n\telse pad = 1;\n\tif(cont) {\n\t\tif(pad) *cont++ = 0;\n\t\tBN_bn2bin(bn, cont);\n\t}\n\treturn pad + BN_num_bytes(bn);\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}', 'int BN_bn2bin(const BIGNUM *a, unsigned char *to)\n\t{\n\tint n,i;\n\tBN_ULONG l;\n\tbn_check_top(a);\n\tn=i=BN_num_bytes(a);\n\twhile (i--)\n\t\t{\n\t\tl=a->d[i/BN_BYTES];\n\t\t*(to++)=(unsigned char)(l>>(8*(i%BN_BYTES)))&0xff;\n\t\t}\n\treturn(n);\n\t}']