crypto/rand/md_rand.c:198: error: INTEGER_OVERFLOW_L2
  ([1, 20] - [-oo, 127]):unsigned64 by call to `SHA1_Update`.
Showing all 8 steps of the trace


crypto/rand/md_rand.c:187:5: Assignment
185.   		{
186.   		j=(num-i);
187.   		j=(j > MD_DIGEST_LENGTH)?MD_DIGEST_LENGTH:j;
           ^
188.   
189.   		MD_Init(&m);

crypto/rand/md_rand.c:187:3: Assignment
185.   		{
186.   		j=(num-i);
187.   		j=(j > MD_DIGEST_LENGTH)?MD_DIGEST_LENGTH:j;
         ^
188.   
189.   		MD_Init(&m);

crypto/rand/md_rand.c:198:4: Call
196.   			}
197.   		else
198.   			MD_Update(&m,&(state[st_idx]),j);
          ^
199.   			
200.   		MD_Update(&m,buf,j);

crypto/sha/sha1dgst.c:117:1: <LHS trace>
115.   	}
116.   
117. > void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
118.   	     unsigned long len)
119.   	{

crypto/sha/sha1dgst.c:117:1: Parameter `len`
  115.   	}
  116.   
  117. > void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
  118.   	     unsigned long len)
  119.   	{

crypto/sha/sha1dgst.c:117:1: <RHS trace>
115.   	}
116.   
117. > void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
118.   	     unsigned long len)
119.   	{

crypto/sha/sha1dgst.c:117:1: Parameter `len`
  115.   	}
  116.   
  117. > void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
  118.   	     unsigned long len)
  119.   	{

crypto/sha/sha1dgst.c:148:4: Binary operation: ([1, 20] - [-oo, 127]):unsigned64 by call to `SHA1_Update` 
  146.   				p[sw]=l;
  147.   				}
  148.   			len-=(SHA_CBLOCK-c->num);
            ^
  149.   
  150.   			sha1_block(c,p,64);

void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
	     unsigned long len)
	{
	register SHA_LONG *p;
	int ew,ec,sw,sc;
	SHA_LONG l;
	if (len == 0) return;
	l=(c->Nl+(len<<3))&0xffffffffL;
	if (l < c->Nl)
		c->Nh++;
	c->Nh+=(len>>29);
	c->Nl=l;
	if (c->num != 0)
		{
		p=c->data;
		sw=c->num>>2;
		sc=c->num&0x03;
		if ((c->num+len) >= SHA_CBLOCK)
			{
			l= p[sw];
			M_p_c2nl(data,l,sc);
			p[sw++]=l;
			for (; sw<SHA_LBLOCK; sw++)
				{
				M_c2nl(data,l);
				p[sw]=l;
				}
			len-=(SHA_CBLOCK-c->num);
			sha1_block(c,p,64);
			c->num=0;
			}
		else
			{
			c->num+=(int)len;
			if ((sc+len) < 4)
				{
				l= p[sw];
				M_p_c2nl_p(data,l,sc,len);
				p[sw]=l;
				}
			else
				{
				ew=(c->num>>2);
				ec=(c->num&0x03);
				l= p[sw];
				M_p_c2nl(data,l,sc);
				p[sw++]=l;
				for (; sw < ew; sw++)
					{ M_c2nl(data,l); p[sw]=l; }
				if (ec)
					{
					M_c2nl_p(data,l,ec);
					p[sw]=l;
					}
				}
			return;
			}
		}
#if 1
#if defined(B_ENDIAN) || defined(SHA1_ASM)
	if ((((unsigned long)data)%sizeof(SHA_LONG)) == 0)
		{
		sw=len/SHA_CBLOCK;
		if (sw)
			{
			sw*=SHA_CBLOCK;
			sha1_block(c,(SHA_LONG *)data,sw);
			data+=sw;
			len-=sw;
			}
		}
#endif
#endif
	p=c->data;
	while (len >= SHA_CBLOCK)
		{
#if defined(B_ENDIAN) || defined(L_ENDIAN)
		if (p != (SHA_LONG *)data)
			memcpy(p,data,SHA_CBLOCK);
		data+=SHA_CBLOCK;
#  ifdef L_ENDIAN
#    ifndef SHA1_ASM
		for (sw=(SHA_LBLOCK/4); sw; sw--)
			{
			Endian_Reverse32(p[0]);
			Endian_Reverse32(p[1]);
			Endian_Reverse32(p[2]);
			Endian_Reverse32(p[3]);
			p+=4;
			}
		p=c->data;
#    endif
#  endif
#else
		for (sw=(SHA_BLOCK/4); sw; sw--)
			{
			M_c2nl(data,l); *(p++)=l;
			M_c2nl(data,l); *(p++)=l;
			M_c2nl(data,l); *(p++)=l;
			M_c2nl(data,l); *(p++)=l;
			}
		p=c->data;
#endif
		sha1_block(c,p,64);
		len-=SHA_CBLOCK;
		}
	ec=(int)len;
	c->num=ec;
	ew=(ec>>2);
	ec&=0x03;
	for (sw=0; sw < ew; sw++)
		{ M_c2nl(data,l); p[sw]=l; }
	M_c2nl_p(data,l,ec);
	p[sw]=l;
	}
['static void ssleay_rand_seed(const void *buf, int num)\n\t{\n\tint i,j,k,st_idx,st_num;\n\tMD_CTX m;\n#ifdef NORAND\n\treturn;\n#endif\n\tCRYPTO_w_lock(CRYPTO_LOCK_RAND);\n\tst_idx=state_index;\n\tst_num=state_num;\n\tstate_index=(state_index+num);\n\tif (state_index >= STATE_SIZE)\n\t\t{\n\t\tstate_index%=STATE_SIZE;\n\t\tstate_num=STATE_SIZE;\n\t\t}\n\telse if (state_num < STATE_SIZE)\n\t\t{\n\t\tif (state_index > state_num)\n\t\t\tstate_num=state_index;\n\t\t}\n\tCRYPTO_w_unlock(CRYPTO_LOCK_RAND);\n\tfor (i=0; i<num; i+=MD_DIGEST_LENGTH)\n\t\t{\n\t\tj=(num-i);\n\t\tj=(j > MD_DIGEST_LENGTH)?MD_DIGEST_LENGTH:j;\n\t\tMD_Init(&m);\n\t\tMD_Update(&m,md,MD_DIGEST_LENGTH);\n\t\tk=(st_idx+j)-STATE_SIZE;\n\t\tif (k > 0)\n\t\t\t{\n\t\t\tMD_Update(&m,&(state[st_idx]),j-k);\n\t\t\tMD_Update(&m,&(state[0]),k);\n\t\t\t}\n\t\telse\n\t\t\tMD_Update(&m,&(state[st_idx]),j);\n\t\tMD_Update(&m,buf,j);\n\t\tMD_Update(&m,(unsigned char *)&(md_count[0]),sizeof(md_count));\n\t\tMD_Final(md,&m);\n\t\tmd_count[1]++;\n\t\tbuf=(const char *)buf + j;\n\t\tfor (k=0; k<j; k++)\n\t\t\t{\n\t\t\tstate[st_idx++]^=md[k];\n\t\t\tif (st_idx >= STATE_SIZE)\n\t\t\t\t{\n\t\t\t\tst_idx=0;\n\t\t\t\tst_num=STATE_SIZE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tmemset((char *)&m,0,sizeof(m));\n\t}', 'void SHA1_Update(SHA_CTX *c, const register unsigned char *data,\n\t     unsigned long len)\n\t{\n\tregister SHA_LONG *p;\n\tint ew,ec,sw,sc;\n\tSHA_LONG l;\n\tif (len == 0) return;\n\tl=(c->Nl+(len<<3))&0xffffffffL;\n\tif (l < c->Nl)\n\t\tc->Nh++;\n\tc->Nh+=(len>>29);\n\tc->Nl=l;\n\tif (c->num != 0)\n\t\t{\n\t\tp=c->data;\n\t\tsw=c->num>>2;\n\t\tsc=c->num&0x03;\n\t\tif ((c->num+len) >= SHA_CBLOCK)\n\t\t\t{\n\t\t\tl= p[sw];\n\t\t\tM_p_c2nl(data,l,sc);\n\t\t\tp[sw++]=l;\n\t\t\tfor (; sw<SHA_LBLOCK; sw++)\n\t\t\t\t{\n\t\t\t\tM_c2nl(data,l);\n\t\t\t\tp[sw]=l;\n\t\t\t\t}\n\t\t\tlen-=(SHA_CBLOCK-c->num);\n\t\t\tsha1_block(c,p,64);\n\t\t\tc->num=0;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tc->num+=(int)len;\n\t\t\tif ((sc+len) < 4)\n\t\t\t\t{\n\t\t\t\tl= p[sw];\n\t\t\t\tM_p_c2nl_p(data,l,sc,len);\n\t\t\t\tp[sw]=l;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tew=(c->num>>2);\n\t\t\t\tec=(c->num&0x03);\n\t\t\t\tl= p[sw];\n\t\t\t\tM_p_c2nl(data,l,sc);\n\t\t\t\tp[sw++]=l;\n\t\t\t\tfor (; sw < ew; sw++)\n\t\t\t\t\t{ M_c2nl(data,l); p[sw]=l; }\n\t\t\t\tif (ec)\n\t\t\t\t\t{\n\t\t\t\t\tM_c2nl_p(data,l,ec);\n\t\t\t\t\tp[sw]=l;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\treturn;\n\t\t\t}\n\t\t}\n#if 1\n#if defined(B_ENDIAN) || defined(SHA1_ASM)\n\tif ((((unsigned long)data)%sizeof(SHA_LONG)) == 0)\n\t\t{\n\t\tsw=len/SHA_CBLOCK;\n\t\tif (sw)\n\t\t\t{\n\t\t\tsw*=SHA_CBLOCK;\n\t\t\tsha1_block(c,(SHA_LONG *)data,sw);\n\t\t\tdata+=sw;\n\t\t\tlen-=sw;\n\t\t\t}\n\t\t}\n#endif\n#endif\n\tp=c->data;\n\twhile (len >= SHA_CBLOCK)\n\t\t{\n#if defined(B_ENDIAN) || defined(L_ENDIAN)\n\t\tif (p != (SHA_LONG *)data)\n\t\t\tmemcpy(p,data,SHA_CBLOCK);\n\t\tdata+=SHA_CBLOCK;\n#  ifdef L_ENDIAN\n#    ifndef SHA1_ASM\n\t\tfor (sw=(SHA_LBLOCK/4); sw; sw--)\n\t\t\t{\n\t\t\tEndian_Reverse32(p[0]);\n\t\t\tEndian_Reverse32(p[1]);\n\t\t\tEndian_Reverse32(p[2]);\n\t\t\tEndian_Reverse32(p[3]);\n\t\t\tp+=4;\n\t\t\t}\n\t\tp=c->data;\n#    endif\n#  endif\n#else\n\t\tfor (sw=(SHA_BLOCK/4); sw; sw--)\n\t\t\t{\n\t\t\tM_c2nl(data,l); *(p++)=l;\n\t\t\tM_c2nl(data,l); *(p++)=l;\n\t\t\tM_c2nl(data,l); *(p++)=l;\n\t\t\tM_c2nl(data,l); *(p++)=l;\n\t\t\t}\n\t\tp=c->data;\n#endif\n\t\tsha1_block(c,p,64);\n\t\tlen-=SHA_CBLOCK;\n\t\t}\n\tec=(int)len;\n\tc->num=ec;\n\tew=(ec>>2);\n\tec&=0x03;\n\tfor (sw=0; sw < ew; sw++)\n\t\t{ M_c2nl(data,l); p[sw]=l; }\n\tM_c2nl_p(data,l,ec);\n\tp[sw]=l;\n\t}']