crypto/des/rpc_enc.c:78: error: BUFFER_OVERRUN_L2
  Offset: [-2, 27] Size: 16 by call to `des_ecb_encrypt`.
Showing all 10 steps of the trace


crypto/des/rpc_enc.c:69:1: Array declaration
67.   #endif
68.   
69. > int _des_crypt(char *buf, int len, struct desparams *desp)
70.   	{
71.   	des_key_schedule ks;

crypto/des/rpc_enc.c:78:3: Call
76.   
77.   	if (desp->des_mode == CBC)
78.   		des_ecb_encrypt(desp->UDES.UDES_buf,desp->UDES.UDES_buf,ks,
        ^
79.   				enc);
80.   	else

crypto/des/ecb_enc.c:106:1: Parameter `*ks`
  104.   		
  105.   
  106. > void des_ecb_encrypt(const des_cblock in, des_cblock out, des_key_schedule ks,
  107.   	     int enc)
  108.   	{

crypto/des/ecb_enc.c:114:2: Call
  112.   	c2l(in,l); ll[0]=l;
  113.   	c2l(in,l); ll[1]=l;
  114.   	des_encrypt(ll,ks,enc);
          ^
  115.   	l=ll[0]; l2c(l,out);
  116.   	l=ll[1]; l2c(l,out);

crypto/des/des_enc.c:139:8: <Offset trace>
137.   		D_ENCRYPT(r,l, 0); /*  1 */
138.   #else
139.   		for (i=30; i>0; i-=8)
              ^
140.   			{
141.   			D_ENCRYPT(l,r,i-0); /* 16 */

crypto/des/des_enc.c:139:8: Assignment
    137.   		D_ENCRYPT(r,l, 0); /*  1 */
    138.   #else
    139.   		for (i=30; i>0; i-=8)
                  ^
    140.   			{
    141.   			D_ENCRYPT(l,r,i-0); /* 16 */

crypto/des/des_enc.c:61:1: <Length trace>
59.   #include "des_locl.h"
60.   
61. > void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
62.   	{
63.   	register DES_LONG l,r,t,u;

crypto/des/des_enc.c:61:1: Parameter `*ks`
    59.   #include "des_locl.h"
    60.   
    61. > void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
    62.   	{
    63.   	register DES_LONG l,r,t,u;

crypto/des/des_enc.c:87:2: Assignment
    85.   	l=ROTATE(l,29)&0xffffffffL;
    86.   
    87.   	s=(DES_LONG *)ks;
           ^
    88.   	/* I don't know if it is worth the effort of loop unrolling the
    89.   	 * inner loop */

crypto/des/des_enc.c:143:4: Array access: Offset: [-2, 27] Size: 16 by call to `des_ecb_encrypt` 
    141.   			D_ENCRYPT(l,r,i-0); /* 16 */
    142.   			D_ENCRYPT(r,l,i-2); /* 15 */
    143.   			D_ENCRYPT(l,r,i-4); /* 14 */
              ^
    144.   			D_ENCRYPT(r,l,i-6); /* 13 */
    145.   			}

void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)
	{
	register DES_LONG l,r,t,u;
#ifdef DES_PTR
	register const unsigned char *des_SP=(const unsigned char *)des_SPtrans;
#endif
#ifndef DES_UNROLL
	register int i;
#endif
	register DES_LONG *s;
	r=data[0];
	l=data[1];
	IP(r,l);
	r=ROTATE(r,29)&0xffffffffL;
	l=ROTATE(l,29)&0xffffffffL;
	s=(DES_LONG *)ks;
	if (enc)
		{
#ifdef DES_UNROLL
		D_ENCRYPT(l,r, 0);
		D_ENCRYPT(r,l, 2);
		D_ENCRYPT(l,r, 4);
		D_ENCRYPT(r,l, 6);
		D_ENCRYPT(l,r, 8);
		D_ENCRYPT(r,l,10);
		D_ENCRYPT(l,r,12);
		D_ENCRYPT(r,l,14);
		D_ENCRYPT(l,r,16);
		D_ENCRYPT(r,l,18);
		D_ENCRYPT(l,r,20);
		D_ENCRYPT(r,l,22);
		D_ENCRYPT(l,r,24);
		D_ENCRYPT(r,l,26);
		D_ENCRYPT(l,r,28);
		D_ENCRYPT(r,l,30);
#else
		for (i=0; i<32; i+=8)
			{
			D_ENCRYPT(l,r,i+0);
			D_ENCRYPT(r,l,i+2);
			D_ENCRYPT(l,r,i+4);
			D_ENCRYPT(r,l,i+6);
			}
#endif
		}
	else
		{
#ifdef DES_UNROLL
		D_ENCRYPT(l,r,30);
		D_ENCRYPT(r,l,28);
		D_ENCRYPT(l,r,26);
		D_ENCRYPT(r,l,24);
		D_ENCRYPT(l,r,22);
		D_ENCRYPT(r,l,20);
		D_ENCRYPT(l,r,18);
		D_ENCRYPT(r,l,16);
		D_ENCRYPT(l,r,14);
		D_ENCRYPT(r,l,12);
		D_ENCRYPT(l,r,10);
		D_ENCRYPT(r,l, 8);
		D_ENCRYPT(l,r, 6);
		D_ENCRYPT(r,l, 4);
		D_ENCRYPT(l,r, 2);
		D_ENCRYPT(r,l, 0);
#else
		for (i=30; i>0; i-=8)
			{
			D_ENCRYPT(l,r,i-0);
			D_ENCRYPT(r,l,i-2);
			D_ENCRYPT(l,r,i-4);
			D_ENCRYPT(r,l,i-6);
			}
#endif
		}
	l=ROTATE(l,3)&0xffffffffL;
	r=ROTATE(r,3)&0xffffffffL;
	FP(r,l);
	data[0]=l;
	data[1]=r;
	l=r=t=u=0;
	}
['int _des_crypt(char *buf, int len, struct desparams *desp)\n\t{\n\tdes_key_schedule ks;\n\tint enc;\n\tdes_set_key(desp->des_key,ks);\n\tenc=(desp->des_dir == ENCRYPT)?DES_ENCRYPT:DES_DECRYPT;\n\tif (desp->des_mode == CBC)\n\t\tdes_ecb_encrypt(desp->UDES.UDES_buf,desp->UDES.UDES_buf,ks,\n\t\t\t\tenc);\n\telse\n\t\t{\n\t\tdes_ncbc_encrypt(desp->UDES.UDES_buf,desp->UDES.UDES_buf,\n\t\t\t\tlen,ks,desp->des_ivec,enc);\n#ifdef undef\n\t\ta=(char *)&(desp->UDES.UDES_buf[len-8]);\n\t\tb=(char *)&(desp->des_ivec[0]);\n\t\t*(a++)= *(b++); *(a++)= *(b++);\n\t\t*(a++)= *(b++); *(a++)= *(b++);\n\t\t*(a++)= *(b++); *(a++)= *(b++);\n\t\t*(a++)= *(b++); *(a++)= *(b++);\n#endif\n\t\t}\n\treturn(1);\n\t}', 'void des_ecb_encrypt(const des_cblock in, des_cblock out, des_key_schedule ks,\n\t     int enc)\n\t{\n\tregister DES_LONG l;\n\tDES_LONG ll[2];\n\tc2l(in,l); ll[0]=l;\n\tc2l(in,l); ll[1]=l;\n\tdes_encrypt(ll,ks,enc);\n\tl=ll[0]; l2c(l,out);\n\tl=ll[1]; l2c(l,out);\n\tl=ll[0]=ll[1]=0;\n\t}', 'void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc)\n\t{\n\tregister DES_LONG l,r,t,u;\n#ifdef DES_PTR\n\tregister const unsigned char *des_SP=(const unsigned char *)des_SPtrans;\n#endif\n#ifndef DES_UNROLL\n\tregister int i;\n#endif\n\tregister DES_LONG *s;\n\tr=data[0];\n\tl=data[1];\n\tIP(r,l);\n\tr=ROTATE(r,29)&0xffffffffL;\n\tl=ROTATE(l,29)&0xffffffffL;\n\ts=(DES_LONG *)ks;\n\tif (enc)\n\t\t{\n#ifdef DES_UNROLL\n\t\tD_ENCRYPT(l,r, 0);\n\t\tD_ENCRYPT(r,l, 2);\n\t\tD_ENCRYPT(l,r, 4);\n\t\tD_ENCRYPT(r,l, 6);\n\t\tD_ENCRYPT(l,r, 8);\n\t\tD_ENCRYPT(r,l,10);\n\t\tD_ENCRYPT(l,r,12);\n\t\tD_ENCRYPT(r,l,14);\n\t\tD_ENCRYPT(l,r,16);\n\t\tD_ENCRYPT(r,l,18);\n\t\tD_ENCRYPT(l,r,20);\n\t\tD_ENCRYPT(r,l,22);\n\t\tD_ENCRYPT(l,r,24);\n\t\tD_ENCRYPT(r,l,26);\n\t\tD_ENCRYPT(l,r,28);\n\t\tD_ENCRYPT(r,l,30);\n#else\n\t\tfor (i=0; i<32; i+=8)\n\t\t\t{\n\t\t\tD_ENCRYPT(l,r,i+0);\n\t\t\tD_ENCRYPT(r,l,i+2);\n\t\t\tD_ENCRYPT(l,r,i+4);\n\t\t\tD_ENCRYPT(r,l,i+6);\n\t\t\t}\n#endif\n\t\t}\n\telse\n\t\t{\n#ifdef DES_UNROLL\n\t\tD_ENCRYPT(l,r,30);\n\t\tD_ENCRYPT(r,l,28);\n\t\tD_ENCRYPT(l,r,26);\n\t\tD_ENCRYPT(r,l,24);\n\t\tD_ENCRYPT(l,r,22);\n\t\tD_ENCR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