Fix buffer overrun. Coverity ID 106.

This commit is contained in:
Ben Laurie 2007-04-04 15:13:31 +00:00
parent 313fce7b61
commit 260c497cdd

View File

@ -173,7 +173,7 @@ void Camellia_cfbr_encrypt_block(const unsigned char *in,unsigned char *out,
unsigned char *ivec,const int enc) unsigned char *ivec,const int enc)
{ {
int n,rem,num; int n,rem,num;
unsigned char ovec[CAMELLIA_BLOCK_SIZE*2]; unsigned char ovec[CAMELLIA_BLOCK_SIZE*2 + 1]; /* +1 because we dereference (but don't use) one byte beyond the end */
if (nbits<=0 || nbits>128) return; if (nbits<=0 || nbits>128) return;