crypto/bn/bn_print.c:135: error: BUFFER_OVERRUN_L2
  Offset: [0, 1000000000] Size: 256 by call to `BN_div_word`.
Showing all 11 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:86:1: Parameter `w`
  84.   	}
  85.   
  86. > BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w)
  87.   	{
  88.   	BN_ULONG ret;

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

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: 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:240:4: Call
    238.   	if (d == 0) return(BN_MASK2);
    239.   
    240.   	i=BN_num_bits_word(d);
              ^
    241.   	if ((i != BN_BITS2) && (h > (BN_ULONG)1<<i))
    242.   		{

crypto/bn/bn_lib.c:151:1: <Offset trace>
149.   	}
150.   
151. > int BN_num_bits_word(BN_ULONG l)
152.   	{
153.   	static const char bits[256]={

crypto/bn/bn_lib.c:151:1: Parameter `l`
      149.   	}
      150.   
      151. > int BN_num_bits_word(BN_ULONG l)
      152.   	{
      153.   	static const char bits[256]={

crypto/bn/bn_lib.c:153:2: <Length trace>
151.   int BN_num_bits_word(BN_ULONG l)
152.   	{
153.   	static const char bits[256]={
        ^
154.   		0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
155.   		5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,

crypto/bn/bn_lib.c:153:2: Array declaration
      151.   int BN_num_bits_word(BN_ULONG l)
      152.   	{
      153.   	static const char bits[256]={
              ^
      154.   		0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
      155.   		5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,

crypto/bn/bn_lib.c:222:12: Array access: Offset: [0, 1000000000] Size: 256 by call to `BN_div_word` 
      220.   			{
      221.   			if (l & 0xff000000L)
      222.   				return(bits[(int)(l>>24L)]+24);
                        ^
      223.   			else	return(bits[(int)(l>>16L)]+16);
      224.   			}

int BN_num_bits_word(BN_ULONG l)
	{
	static const char bits[256]={
		0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
		5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
		6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
		6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
		7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
		};
#if defined(SIXTY_FOUR_BIT_LONG)
	if (l & 0xffffffff00000000L)
		{
		if (l & 0xffff000000000000L)
			{
			if (l & 0xff00000000000000L)
				{
				return(bits[(int)(l>>56)]+56);
				}
			else	return(bits[(int)(l>>48)]+48);
			}
		else
			{
			if (l & 0x0000ff0000000000L)
				{
				return(bits[(int)(l>>40)]+40);
				}
			else	return(bits[(int)(l>>32)]+32);
			}
		}
	else
#else
#ifdef SIXTY_FOUR_BIT
	if (l & 0xffffffff00000000LL)
		{
		if (l & 0xffff000000000000LL)
			{
			if (l & 0xff00000000000000LL)
				{
				return(bits[(int)(l>>56)]+56);
				}
			else	return(bits[(int)(l>>48)]+48);
			}
		else
			{
			if (l & 0x0000ff0000000000LL)
				{
				return(bits[(int)(l>>40)]+40);
				}
			else	return(bits[(int)(l>>32)]+32);
			}
		}
	else
#endif
#endif
		{
#if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
		if (l & 0xffff0000L)
			{
			if (l & 0xff000000L)
				return(bits[(int)(l>>24L)]+24);
			else	return(bits[(int)(l>>16L)]+16);
			}
		else
#endif
			{
#if defined(SIXTEEN_BIT) || defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
			if (l & 0xff00L)
				return(bits[(int)(l>>8)]+8);
			else
#endif
				return(bits[(int)(l   )]  );
			}
		}
	}
["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}', 'int BN_num_bits_word(BN_ULONG l)\n\t{\n\tstatic const char bits[256]={\n\t\t0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,\n\t\t5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,\n\t\t6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n\t\t6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n\t\t7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n\t\t7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n\t\t7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n\t\t7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n\t\t};\n#if defined(SIXTY_FOUR_BIT_LONG)\n\tif (l & 0xffffffff00000000L)\n\t\t{\n\t\tif (l & 0xffff000000000000L)\n\t\t\t{\n\t\t\tif (l & 0xff00000000000000L)\n\t\t\t\t{\n\t\t\t\treturn(bits[(int)(l>>56)]+56);\n\t\t\t\t}\n\t\t\telse\treturn(bits[(int)(l>>48)]+48);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (l & 0x0000ff0000000000L)\n\t\t\t\t{\n\t\t\t\treturn(bits[(int)(l>>40)]+40);\n\t\t\t\t}\n\t\t\telse\treturn(bits[(int)(l>>32)]+32);\n\t\t\t}\n\t\t}\n\telse\n#else\n#ifdef SIXTY_FOUR_BIT\n\tif (l & 0xffffffff00000000LL)\n\t\t{\n\t\tif (l & 0xffff000000000000LL)\n\t\t\t{\n\t\t\tif (l & 0xff00000000000000LL)\n\t\t\t\t{\n\t\t\t\treturn(bits[(int)(l>>56)]+56);\n\t\t\t\t}\n\t\t\telse\treturn(bits[(int)(l>>48)]+48);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (l & 0x0000ff0000000000LL)\n\t\t\t\t{\n\t\t\t\treturn(bits[(int)(l>>40)]+40);\n\t\t\t\t}\n\t\t\telse\treturn(bits[(int)(l>>32)]+32);\n\t\t\t}\n\t\t}\n\telse\n#endif\n#endif\n\t\t{\n#if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)\n\t\tif (l & 0xffff0000L)\n\t\t\t{\n\t\t\tif (l & 0xff000000L)\n\t\t\t\treturn(bits[(int)(l>>24L)]+24);\n\t\t\telse\treturn(bits[(int)(l>>16L)]+16);\n\t\t\t}\n\t\telse\n#endif\n\t\t\t{\n#if defined(SIXTEEN_BIT) || defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)\n\t\t\tif (l & 0xff00L)\n\t\t\t\treturn(bits[(int)(l>>8)]+8);\n\t\t\telse\n#endif\n\t\t\t\treturn(bits[(int)(l   )]  );\n\t\t\t}\n\t\t}\n\t}']