crypto/bn/bn_mpi.c:85: error: INTEGER_OVERFLOW_L2
  ([0, `a->top`] - 1):unsigned64 by call to `BN_bn2bin`.
Showing all 9 steps of the trace


crypto/bn/bn_mpi.c:63:1: Parameter `a->top`
61.   #include "bn_lcl.h"
62.   
63. > int BN_bn2mpi(const BIGNUM *a, unsigned char *d)
64.   	{
65.   	int bits;

crypto/bn/bn_mpi.c:70:7: Call
68.   	long l;
69.   
70.   	bits=BN_num_bits(a);
            ^
71.   	num=(bits+7)/8;
72.   	if (bits > 0)

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_mpi.c:85:6: Call
83.   	d[3]=(unsigned char)(l    )&0xff;
84.   	if (ext) d[4]=0;
85.   	num=BN_bn2bin(a,&(d[4+ext]));
           ^
86.   	if (a->neg)
87.   		d[4]|=0x80;

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, a->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]));
	}
['int BN_bn2mpi(const BIGNUM *a, unsigned char *d)\n\t{\n\tint bits;\n\tint num=0;\n\tint ext=0;\n\tlong l;\n\tbits=BN_num_bits(a);\n\tnum=(bits+7)/8;\n\tif (bits > 0)\n\t\t{\n\t\text=((bits & 0x07) == 0);\n\t\t}\n\tif (d == NULL)\n\t\treturn(num+4+ext);\n\tl=num+ext;\n\td[0]=(unsigned char)(l>>24)&0xff;\n\td[1]=(unsigned char)(l>>16)&0xff;\n\td[2]=(unsigned char)(l>> 8)&0xff;\n\td[3]=(unsigned char)(l    )&0xff;\n\tif (ext) d[4]=0;\n\tnum=BN_bn2bin(a,&(d[4+ext]));\n\tif (a->neg)\n\t\td[4]|=0x80;\n\treturn(num+4+ext);\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}', '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}']