crypto/camellia/camellia.c:500: error: BUFFER_OVERRUN_L2
  Offset: [5, 34] Size: 34.
Showing all 5 steps of the trace


crypto/camellia/camellia.c:497:8: <Offset trace>
495.   		memcpy(keyTable, t, 16);
496.   		memcpy(keyTable+4, t+12, 16);
497.   		for (i = 4; i < 34; i += 2)
              ^
498.   			{
499.   			RotBlock(t + KIDX2[i + 0], KSFT2[i + 0], keyTable+i*2);

crypto/camellia/camellia.c:497:8: Assignment
495.   		memcpy(keyTable, t, 16);
496.   		memcpy(keyTable+4, t+12, 16);
497.   		for (i = 4; i < 34; i += 2)
              ^
498.   			{
499.   			RotBlock(t + KIDX2[i + 0], KSFT2[i + 0], keyTable+i*2);

crypto/camellia/camellia.c:434:1: <Length trace>
432.   };
433.   
434. > const int KIDX2[34] = {
435.       0, 0, 12, 12, 4, 4, 8, 8, 4, 4, 12, 12, 0, 0, 8, 8, 0, 0, 4, 4, 12, 12, 
436.       0, 0, 8, 8, 4, 4, 8, 8, 0, 0, 12, 12 

crypto/camellia/camellia.c:434:1: Array declaration
432.   };
433.   
434. > const int KIDX2[34] = {
435.       0, 0, 12, 12, 4, 4, 8, 8, 4, 4, 12, 12, 0, 0, 8, 8, 0, 0, 4, 4, 12, 12, 
436.       0, 0, 8, 8, 4, 4, 8, 8, 0, 0, 12, 12 

crypto/camellia/camellia.c:500:17: Array access: Offset: [5, 34] Size: 34
498.   			{
499.   			RotBlock(t + KIDX2[i + 0], KSFT2[i + 0], keyTable+i*2);
500.   			RotBlock(t + KIDX2[i + 1], KSFT2[i + 1], keyTable+i*2+2);
                       ^
501.   			}
502.   		}

void Camellia_Ekeygen(const int keyBitLength, const Byte *rawKey, KEY_TABLE_TYPE keyTable)
	{
	Word t[16];
	int  i;
	if (keyBitLength == 128)
		{
		CopyConvertEndianness16in((Word *)rawKey, (Word *)t);
		for (i = 4; i < 8; i++)
			t[i] = 0;
		}
	else if (keyBitLength == 192)
		{
		CopyConvertEndianness16in((Word *)rawKey, (Word *)t);
		for (i =  4; i < 6; i++)
			{
			Word tmp = (rawKey[4*i] << 24) | (rawKey[4*i+1] << 16) |
				(rawKey[4*i+2] << 8) | (rawKey[4*i+3] << 0);
			t[i] = tmp;
			t[i+2] = ~tmp;
			}
		}
	else if (keyBitLength == 256)
		{
		CopyConvertEndianness16in((Word *)rawKey, (Word *)t);
		CopyConvertEndianness16in(((Word *)rawKey)+4, ((Word *)t)+4);
		}
	XorBlock(t, t+4, t+8);
	Camellia_Feistel(t+8, SIGMA, 2);
	XorBlock(t+8, t, t+8);
	Camellia_Feistel(t+8, SIGMA+4,2);
	if (keyBitLength == 128)
		{
		memcpy(keyTable, t, 16);
		memcpy(keyTable+4, t+8, 16);
		for (i = 4; i < 26; i += 2 )
			{
			RotBlock(t + KIDX1[i + 0], KSFT1[i + 0], keyTable+i*2);
			RotBlock(t + KIDX1[i + 1], KSFT1[i + 1], keyTable+i*2+2);
			}
		}
	else
		{
		XorBlock(t+8, t+4, t+12);
		Camellia_Feistel(t+12, SIGMA+8,2);
		memcpy(keyTable, t, 16);
		memcpy(keyTable+4, t+12, 16);
		for (i = 4; i < 34; i += 2)
			{
			RotBlock(t + KIDX2[i + 0], KSFT2[i + 0], keyTable+i*2);
			RotBlock(t + KIDX2[i + 1], KSFT2[i + 1], keyTable+i*2+2);
			}
		}
	}
['void Camellia_Ekeygen(const int keyBitLength, const Byte *rawKey, KEY_TABLE_TYPE keyTable)\n\t{\n\tWord t[16];\n\tint  i;\n\tif (keyBitLength == 128)\n\t\t{\n\t\tCopyConvertEndianness16in((Word *)rawKey, (Word *)t);\n\t\tfor (i = 4; i < 8; i++)\n\t\t\tt[i] = 0;\n\t\t}\n\telse if (keyBitLength == 192)\n\t\t{\n\t\tCopyConvertEndianness16in((Word *)rawKey, (Word *)t);\n\t\tfor (i =  4; i < 6; i++)\n\t\t\t{\n\t\t\tWord tmp = (rawKey[4*i] << 24) | (rawKey[4*i+1] << 16) |\n\t\t\t\t(rawKey[4*i+2] << 8) | (rawKey[4*i+3] << 0);\n\t\t\tt[i] = tmp;\n\t\t\tt[i+2] = ~tmp;\n\t\t\t}\n\t\t}\n\telse if (keyBitLength == 256)\n\t\t{\n\t\tCopyConvertEndianness16in((Word *)rawKey, (Word *)t);\n\t\tCopyConvertEndianness16in(((Word *)rawKey)+4, ((Word *)t)+4);\n\t\t}\n\tXorBlock(t, t+4, t+8);\n\tCamellia_Feistel(t+8, SIGMA, 2);\n\tXorBlock(t+8, t, t+8);\n\tCamellia_Feistel(t+8, SIGMA+4,2);\n\tif (keyBitLength == 128)\n\t\t{\n\t\tmemcpy(keyTable, t, 16);\n\t\tmemcpy(keyTable+4, t+8, 16);\n\t\tfor (i = 4; i < 26; i += 2 )\n\t\t\t{\n\t\t\tRotBlock(t + KIDX1[i + 0], KSFT1[i + 0], keyTable+i*2);\n\t\t\tRotBlock(t + KIDX1[i + 1], KSFT1[i + 1], keyTable+i*2+2);\n\t\t\t}\n\t\t}\n\telse\n\t\t{\n\t\tXorBlock(t+8, t+4, t+12);\n\t\tCamellia_Feistel(t+12, SIGMA+8,2);\n\t\tmemcpy(keyTable, t, 16);\n\t\tmemcpy(keyTable+4, t+12, 16);\n\t\tfor (i = 4; i < 34; i += 2)\n\t\t\t{\n\t\t\tRotBlock(t + KIDX2[i + 0], KSFT2[i + 0], keyTable+i*2);\n\t\t\tRotBlock(t + KIDX2[i + 1], KSFT2[i + 1], keyTable+i*2+2);\n\t\t\t}\n\t\t}\n\t}']