this is a part of ciphers.c
=====
SNIP
if ((length % blocksize) !=0)
{
*buffer = realloc(*buffer, length + (blocksize - (length
%blocksize)));
#ifdef DEBUG
_printf ("LENGTH before fill: %d\n",length);
_printf ("FILLCOUNT: %d\n",blocksize - (length%
blocksize));
#endif
}
tmpbuf=*buffer;
for (i=1;i<=blocksize - (length%blocksize);i++)
tmpbuf[length+i]='\0';
Occurs if: ...the filesize if a multipile of blocksize (during
encoding), for example blocksize = 16, filesize = 160.
-> no realloc
-> for (i = 1; i <= (16 - (160 % 16)); i++) {
16 - (160 % 16) == 16 but it SHOULD be 0.
I'd suggest you to move the for loop into the block
starting with if (length % blocksize) != 0).
Wait for more - I am still looking at it :)
Logged In: YES
user_id=453831
And change
*outbuflen = length+(blocksize - (length%blocksize));
to
*outbuflen = (length%blocksize == 0) ? length : length +
(blocksize - (length%blocksize));
while you are at it ;) but please check this line, I just wrote it
from scratch....