crypto/bn/bn_print.c:135: error: INTEGER_OVERFLOW_L2
  ([1, 4294967295] - [1, 1000000000]):unsigned64 by call to `BN_div_word`.
Showing all 8 steps of the trace


crypto/bn/bn_print.c:135:8: Call
133.   		while (!BN_is_zero(t))
134.   			{
135.   			*lp=BN_div_word(t,BN_DEC_CONV);
              ^
136.   			lp++;
137.   			}

crypto/bn/bn_word.c:92:2: Assignment
  90.   
  91.   	if (a->top == 0) return(0);
  92.   	ret=0;
         ^
  93.   	w&=BN_MASK2;
  94.   	for (i=a->top-1; i>=0; i--)

crypto/bn/bn_word.c:99:5: Call
  97.   		
  98.   		l=a->d[i];
  99.   		d=bn_div_words(ret,l,w);
             ^
  100.   		ret=(l-((d*w)&BN_MASK2))&BN_MASK2;
  101.   		a->d[i]=d;

crypto/bn/bn_asm.c:233:1: <LHS trace>
231.   /* Divide h-l by d and return the result. */
232.   /* I need to test this some more :-( */
233. > BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
234.   	{
235.   	BN_ULONG dh,dl,q,ret=0,th,tl,t;

crypto/bn/bn_asm.c:233:1: Parameter `d`
    231.   /* Divide h-l by d and return the result. */
    232.   /* I need to test this some more :-( */
    233. > BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
    234.   	{
    235.   	BN_ULONG dh,dl,q,ret=0,th,tl,t;

crypto/bn/bn_asm.c:233:1: <RHS trace>
231.   /* Divide h-l by d and return the result. */
232.   /* I need to test this some more :-( */
233. > BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
234.   	{
235.   	BN_ULONG dh,dl,q,ret=0,th,tl,t;

crypto/bn/bn_asm.c:233:1: Parameter `d`
    231.   /* Divide h-l by d and return the result. */
    232.   /* I need to test this some more :-( */
    233. > BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
    234.   	{
    235.   	BN_ULONG dh,dl,q,ret=0,th,tl,t;

crypto/bn/bn_asm.c:249:14: Binary operation: ([1, 4294967295] - [1, 1000000000]):unsigned64 by call to `BN_div_word` 
    247.   		}
    248.   	i=BN_BITS2-i;
    249.   	if (h >= d) h-=d;
                        ^
    250.   
    251.   	if (i)

BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
	{
	BN_ULONG dh,dl,q,ret=0,th,tl,t;
	int i,count=2;
	if (d == 0) return(BN_MASK2);
	i=BN_num_bits_word(d);
	if ((i != BN_BITS2) && (h > (BN_ULONG)1<<i))
		{
#if !defined(NO_STDIO) && !defined(WIN16)
		fprintf(stderr,"Division would overflow (%d)\n",i);
#endif
		abort();
		}
	i=BN_BITS2-i;
	if (h >= d) h-=d;
	if (i)
		{
		d<<=i;
		h=(h<<i)|(l>>(BN_BITS2-i));
		l<<=i;
		}
	dh=(d&BN_MASK2h)>>BN_BITS4;
	dl=(d&BN_MASK2l);
	for (;;)
		{
		if ((h>>BN_BITS4) == dh)
			q=BN_MASK2l;
		else
			q=h/dh;
		for (;;)
			{
			t=(h-q*dh);
			if ((t&BN_MASK2h) ||
				((dl*q) <= (
					(t<<BN_BITS4)+
					((l&BN_MASK2h)>>BN_BITS4))))
				break;
			q--;
			}
		th=q*dh;
		tl=q*dl;
		t=(tl>>BN_BITS4);
		tl=(tl<<BN_BITS4)&BN_MASK2h;
		th+=t;
		if (l < tl) th++;
		l-=tl;
		if (h < th)
			{
			h+=d;
			q--;
			}
		h-=th;
		if (--count == 0) break;
		ret=q<<BN_BITS4;
		h=((h<<BN_BITS4)|(l>>BN_BITS4))&BN_MASK2;
		l=(l&BN_MASK2l)<<BN_BITS4;
		}
	ret|=q;
	return(ret);
	}
["char *BN_bn2dec(BIGNUM *a)\n\t{\n\tint i=0,num;\n\tchar *buf=NULL;\n\tchar *p;\n\tBIGNUM *t=NULL;\n\tBN_ULONG *bn_data=NULL,*lp;\n\ti=BN_num_bits(a)*3;\n\tnum=(i/10+i/1000+3)+1;\n\tbn_data=(BN_ULONG *)Malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG));\n\tbuf=(char *)Malloc(num+3);\n\tif ((buf == NULL) || (bn_data == NULL))\n\t\t{\n\t\tBNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE);\n\t\tgoto err;\n\t\t}\n\tif ((t=BN_dup(a)) == NULL) goto err;\n\tp=buf;\n\tlp=bn_data;\n\tif (t->neg) *(p++)='-';\n\tif (t->top == 0)\n\t\t{\n\t\t*(p++)='0';\n\t\t*(p++)='\\0';\n\t\t}\n\telse\n\t\t{\n\t\ti=0;\n\t\twhile (!BN_is_zero(t))\n\t\t\t{\n\t\t\t*lp=BN_div_word(t,BN_DEC_CONV);\n\t\t\tlp++;\n\t\t\t}\n\t\tlp--;\n\t\tsprintf(p,BN_DEC_FMT1,*lp);\n\t\twhile (*p) p++;\n\t\twhile (lp != bn_data)\n\t\t\t{\n\t\t\tlp--;\n\t\t\tsprintf(p,BN_DEC_FMT2,*lp);\n\t\t\twhile (*p) p++;\n\t\t\t}\n\t\t}\nerr:\n\tif (bn_data != NULL) Free(bn_data);\n\tif (t != NULL) BN_free(t);\n\treturn(buf);\n\t}", 'BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w)\n\t{\n\tBN_ULONG ret;\n\tint i;\n\tif (a->top == 0) return(0);\n\tret=0;\n\tw&=BN_MASK2;\n\tfor (i=a->top-1; i>=0; i--)\n\t\t{\n\t\tBN_ULONG l,d;\n\t\tl=a->d[i];\n\t\td=bn_div_words(ret,l,w);\n\t\tret=(l-((d*w)&BN_MASK2))&BN_MASK2;\n\t\ta->d[i]=d;\n\t\t}\n\tif ((a->top > 0) && (a->d[a->top-1] == 0))\n\t\ta->top--;\n\treturn(ret);\n\t}', 'BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)\n\t{\n\tBN_ULONG dh,dl,q,ret=0,th,tl,t;\n\tint i,count=2;\n\tif (d == 0) return(BN_MASK2);\n\ti=BN_num_bits_word(d);\n\tif ((i != BN_BITS2) && (h > (BN_ULONG)1<<i))\n\t\t{\n#if !defined(NO_STDIO) && !defined(WIN16)\n\t\tfprintf(stderr,"Division would overflow (%d)\\n",i);\n#endif\n\t\tabort();\n\t\t}\n\ti=BN_BITS2-i;\n\tif (h >= d) h-=d;\n\tif (i)\n\t\t{\n\t\td<<=i;\n\t\th=(h<<i)|(l>>(BN_BITS2-i));\n\t\tl<<=i;\n\t\t}\n\tdh=(d&BN_MASK2h)>>BN_BITS4;\n\tdl=(d&BN_MASK2l);\n\tfor (;;)\n\t\t{\n\t\tif ((h>>BN_BITS4) == dh)\n\t\t\tq=BN_MASK2l;\n\t\telse\n\t\t\tq=h/dh;\n\t\tfor (;;)\n\t\t\t{\n\t\t\tt=(h-q*dh);\n\t\t\tif ((t&BN_MASK2h) ||\n\t\t\t\t((dl*q) <= (\n\t\t\t\t\t(t<<BN_BITS4)+\n\t\t\t\t\t((l&BN_MASK2h)>>BN_BITS4))))\n\t\t\t\tbreak;\n\t\t\tq--;\n\t\t\t}\n\t\tth=q*dh;\n\t\ttl=q*dl;\n\t\tt=(tl>>BN_BITS4);\n\t\ttl=(tl<<BN_BITS4)&BN_MASK2h;\n\t\tth+=t;\n\t\tif (l < tl) th++;\n\t\tl-=tl;\n\t\tif (h < th)\n\t\t\t{\n\t\t\th+=d;\n\t\t\tq--;\n\t\t\t}\n\t\th-=th;\n\t\tif (--count == 0) break;\n\t\tret=q<<BN_BITS4;\n\t\th=((h<<BN_BITS4)|(l>>BN_BITS4))&BN_MASK2;\n\t\tl=(l&BN_MASK2l)<<BN_BITS4;\n\t\t}\n\tret|=q;\n\treturn(ret);\n\t}']