crypto/bn/bn_sqr.c:288: error: INTEGER_OVERFLOW_L2
  ([0, 4294967295] + 1):unsigned32.
Showing all 8 steps of the trace


crypto/bn/bn_sqr.c:273:12: <LHS trace>
271.   	 * c1 holds the carry bits
272.   	 */
273.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
                  ^
274.   	if (c1)
275.   		{

crypto/bn/bn_sqr.c:273:12: Call
271.   	 * c1 holds the carry bits
272.   	 */
273.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
                  ^
274.   	if (c1)
275.   		{

crypto/bn/bn_asm.c:346:14: Assignment
  344.   
  345.   	assert(n >= 0);
  346.   	if (n <= 0) return((BN_ULONG)0);
                      ^
  347.   
  348.   	c=0;

crypto/bn/bn_sqr.c:273:2: Assignment
271.   	 * c1 holds the carry bits
272.   	 */
273.   	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
        ^
274.   	if (c1)
275.   		{

crypto/bn/bn_sqr.c:278:3: Assignment
276.   		p= &(r[n+n2]);
277.   		lo= *p;
278.   		ln=(lo+c1)&BN_MASK2;
         ^
279.   		*p=ln;
280.   

crypto/bn/bn_sqr.c:279:3: Assignment
277.   		lo= *p;
278.   		ln=(lo+c1)&BN_MASK2;
279.   		*p=ln;
         ^
280.   
281.   		/* The overflow will stop before we over write

crypto/bn/bn_sqr.c:287:5: Assignment
285.   			do	{
286.   				p++;
287.   				lo= *p;
           ^
288.   				ln=(lo+1)&BN_MASK2;
289.   				*p=ln;

crypto/bn/bn_sqr.c:288:5: Binary operation: ([0, 4294967295] + 1):unsigned32
286.   				p++;
287.   				lo= *p;
288.   				ln=(lo+1)&BN_MASK2;
           ^
289.   				*p=ln;
290.   				} while (ln == 0);

void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)
	{
	int n=n2/2;
	int zero,c1;
	BN_ULONG ln,lo,*p;
#ifdef BN_COUNT
	fprintf(stderr," bn_sqr_recursive %d * %d\n",n2,n2);
#endif
	if (n2 == 4)
		{
#ifndef BN_SQR_COMBA
		bn_sqr_normal(r,a,4,t);
#else
		bn_sqr_comba4(r,a);
#endif
		return;
		}
	else if (n2 == 8)
		{
#ifndef BN_SQR_COMBA
		bn_sqr_normal(r,a,8,t);
#else
		bn_sqr_comba8(r,a);
#endif
		return;
		}
	if (n2 < BN_SQR_RECURSIVE_SIZE_NORMAL)
		{
		bn_sqr_normal(r,a,n2,t);
		return;
		}
	c1=bn_cmp_words(a,&(a[n]),n);
	zero=0;
	if (c1 > 0)
		bn_sub_words(t,a,&(a[n]),n);
	else if (c1 < 0)
		bn_sub_words(t,&(a[n]),a,n);
	else
		zero=1;
	p= &(t[n2*2]);
	if (!zero)
		bn_sqr_recursive(&(t[n2]),t,n,p);
	else
		memset(&(t[n2]),0,n2*sizeof(BN_ULONG));
	bn_sqr_recursive(r,a,n,p);
	bn_sqr_recursive(&(r[n2]),&(a[n]),n,p);
	c1=(int)(bn_add_words(t,r,&(r[n2]),n2));
	c1-=(int)(bn_sub_words(&(t[n2]),t,&(t[n2]),n2));
	c1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));
	if (c1)
		{
		p= &(r[n+n2]);
		lo= *p;
		ln=(lo+c1)&BN_MASK2;
		*p=ln;
		if (ln < (BN_ULONG)c1)
			{
			do	{
				p++;
				lo= *p;
				ln=(lo+1)&BN_MASK2;
				*p=ln;
				} while (ln == 0);
			}
		}
	}
['void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)\n\t{\n\tint n=n2/2;\n\tint zero,c1;\n\tBN_ULONG ln,lo,*p;\n#ifdef BN_COUNT\n\tfprintf(stderr," bn_sqr_recursive %d * %d\\n",n2,n2);\n#endif\n\tif (n2 == 4)\n\t\t{\n#ifndef BN_SQR_COMBA\n\t\tbn_sqr_normal(r,a,4,t);\n#else\n\t\tbn_sqr_comba4(r,a);\n#endif\n\t\treturn;\n\t\t}\n\telse if (n2 == 8)\n\t\t{\n#ifndef BN_SQR_COMBA\n\t\tbn_sqr_normal(r,a,8,t);\n#else\n\t\tbn_sqr_comba8(r,a);\n#endif\n\t\treturn;\n\t\t}\n\tif (n2 < BN_SQR_RECURSIVE_SIZE_NORMAL)\n\t\t{\n\t\tbn_sqr_normal(r,a,n2,t);\n\t\treturn;\n\t\t}\n\tc1=bn_cmp_words(a,&(a[n]),n);\n\tzero=0;\n\tif (c1 > 0)\n\t\tbn_sub_words(t,a,&(a[n]),n);\n\telse if (c1 < 0)\n\t\tbn_sub_words(t,&(a[n]),a,n);\n\telse\n\t\tzero=1;\n\tp= &(t[n2*2]);\n\tif (!zero)\n\t\tbn_sqr_recursive(&(t[n2]),t,n,p);\n\telse\n\t\tmemset(&(t[n2]),0,n2*sizeof(BN_ULONG));\n\tbn_sqr_recursive(r,a,n,p);\n\tbn_sqr_recursive(&(r[n2]),&(a[n]),n,p);\n\tc1=(int)(bn_add_words(t,r,&(r[n2]),n2));\n\tc1-=(int)(bn_sub_words(&(t[n2]),t,&(t[n2]),n2));\n\tc1+=(int)(bn_add_words(&(r[n]),&(r[n]),&(t[n2]),n2));\n\tif (c1)\n\t\t{\n\t\tp= &(r[n+n2]);\n\t\tlo= *p;\n\t\tln=(lo+c1)&BN_MASK2;\n\t\t*p=ln;\n\t\tif (ln < (BN_ULONG)c1)\n\t\t\t{\n\t\t\tdo\t{\n\t\t\t\tp++;\n\t\t\t\tlo= *p;\n\t\t\t\tln=(lo+1)&BN_MASK2;\n\t\t\t\t*p=ln;\n\t\t\t\t} while (ln == 0);\n\t\t\t}\n\t\t}\n\t}', 'BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)\n        {\n\tBN_ULONG c,l,t;\n\tassert(n >= 0);\n\tif (n <= 0) return((BN_ULONG)0);\n\tc=0;\n#ifndef OPENSSL_SMALL_FOOTPRINT\n\twhile (n&~3)\n\t\t{\n\t\tt=a[0];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[0])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[0]=l;\n\t\tt=a[1];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[1])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[1]=l;\n\t\tt=a[2];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[2])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[2]=l;\n\t\tt=a[3];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[3])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[3]=l;\n\t\ta+=4; b+=4; r+=4; n-=4;\n\t\t}\n#endif\n\twhile(n)\n\t\t{\n\t\tt=a[0];\n\t\tt=(t+c)&BN_MASK2;\n\t\tc=(t < c);\n\t\tl=(t+b[0])&BN_MASK2;\n\t\tc+=(l < t);\n\t\tr[0]=l;\n\t\ta++; b++; r++; n--;\n\t\t}\n\treturn((BN_ULONG)c);\n\t}']