crypto/ecdsa/ecdsatest.c:171: error: INTEGER_OVERFLOW_L2
  ([0, 1] - 1):unsigned64 by call to `BN_bn2bin`.
Showing all 10 steps of the trace


crypto/ecdsa/ecdsatest.c:162:8: Call
160.   	if (fbytes_counter >= 8)
161.   		return 0;
162.   	tmp = BN_new();
              ^
163.   	if (!tmp)
164.   		return 0;

crypto/bn/bn_lib.c:308:2: Assignment
  306.   		}
  307.   	ret->flags=BN_FLG_MALLOCED;
  308.   	ret->top=0;
          ^
  309.   	ret->neg=0;
  310.   	ret->dmax=0;

crypto/ecdsa/ecdsatest.c:165:7: Call
163.   	if (!tmp)
164.   		return 0;
165.   	if (!BN_dec2bn(&tmp, numbers[fbytes_counter]))
             ^
166.   		{
167.   		BN_free(tmp);

crypto/bn/bn_print.c:239:1: Parameter `(*bn)->top`
  237.   	}
  238.   
  239. > int BN_dec2bn(BIGNUM **bn, const char *a)
  240.   	{
  241.   	BIGNUM *ret=NULL;

crypto/ecdsa/ecdsatest.c:171:8: Call
169.   		}
170.   	fbytes_counter ++;
171.   	ret = BN_bn2bin(tmp, buf);	
              ^
172.   	if (ret == 0 || ret != num)
173.   		ret = 0;

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, 1] - 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 fbytes(unsigned char *buf, size_t num)\n\t{\n\tint\tret;\n\tBIGNUM\t*tmp = NULL;\n\tif (fbytes_counter >= 8)\n\t\treturn 0;\n\ttmp = BN_new();\n\tif (!tmp)\n\t\treturn 0;\n\tif (!BN_dec2bn(&tmp, numbers[fbytes_counter]))\n\t\t{\n\t\tBN_free(tmp);\n\t\treturn 0;\n\t\t}\n\tfbytes_counter ++;\n\tret = BN_bn2bin(tmp, buf);\n\tif (ret == 0 || ret != num)\n\t\tret = 0;\n\telse\n\t\tret = 1;\n\tif (tmp)\n\t\tBN_free(tmp);\n\treturn ret;\n\t}', 'BIGNUM *BN_new(void)\n\t{\n\tBIGNUM *ret;\n\tif ((ret=(BIGNUM *)OPENSSL_malloc(sizeof(BIGNUM))) == NULL)\n\t\t{\n\t\tBNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->flags=BN_FLG_MALLOCED;\n\tret->top=0;\n\tret->neg=0;\n\tret->dmax=0;\n\tret->d=NULL;\n\tbn_check_top(ret);\n\treturn(ret);\n\t}', "int BN_dec2bn(BIGNUM **bn, const char *a)\n\t{\n\tBIGNUM *ret=NULL;\n\tBN_ULONG l=0;\n\tint neg=0,i,j;\n\tint num;\n\tif ((a == NULL) || (*a == '\\0')) return(0);\n\tif (*a == '-') { neg=1; a++; }\n\tfor (i=0; isdigit((unsigned char) a[i]); i++)\n\t\t;\n\tnum=i+neg;\n\tif (bn == NULL) return(num);\n\tif (*bn == NULL)\n\t\t{\n\t\tif ((ret=BN_new()) == NULL) return(0);\n\t\t}\n\telse\n\t\t{\n\t\tret= *bn;\n\t\tBN_zero(ret);\n\t\t}\n\tif (bn_expand(ret,i*4) == NULL) goto err;\n\tj=BN_DEC_NUM-(i%BN_DEC_NUM);\n\tif (j == BN_DEC_NUM) j=0;\n\tl=0;\n\twhile (*a)\n\t\t{\n\t\tl*=10;\n\t\tl+= *a-'0';\n\t\ta++;\n\t\tif (++j == BN_DEC_NUM)\n\t\t\t{\n\t\t\tBN_mul_word(ret,BN_DEC_CONV);\n\t\t\tBN_add_word(ret,l);\n\t\t\tl=0;\n\t\t\tj=0;\n\t\t\t}\n\t\t}\n\tret->neg=neg;\n\tbn_correct_top(ret);\n\t*bn=ret;\n\tbn_check_top(ret);\n\treturn(num);\nerr:\n\tif (*bn == NULL) BN_free(ret);\n\treturn(0);\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}', '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}']