* eet: correctly handle length of ciphered/compressed data.
SVN revision: 54683
This commit is contained in:
parent
080d4c8d35
commit
c89cf15ed7
|
@ -1802,15 +1802,21 @@ eet_read_cipher(Eet_File *ef,
|
||||||
unsigned int data_deciphered_sz = 0;
|
unsigned int data_deciphered_sz = 0;
|
||||||
/* if we already have the data in ram... copy that */
|
/* if we already have the data in ram... copy that */
|
||||||
|
|
||||||
|
if (efn->ciphered && efn->size > size)
|
||||||
|
{
|
||||||
|
size = efn->size;
|
||||||
|
data = realloc(data, efn->size);
|
||||||
|
}
|
||||||
|
|
||||||
if (efn->data)
|
if (efn->data)
|
||||||
memcpy(data, efn->data, efn->size);
|
memcpy(data, efn->data, size);
|
||||||
else
|
else
|
||||||
if (!read_data_from_disk(ef, efn, data, size))
|
if (!read_data_from_disk(ef, efn, data, size))
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
if (efn->ciphered && cipher_key)
|
if (efn->ciphered && cipher_key)
|
||||||
{
|
{
|
||||||
if (eet_decipher(data, size, cipher_key, strlen(cipher_key),
|
if (eet_decipher(data, efn->size, cipher_key, strlen(cipher_key),
|
||||||
&data_deciphered, &data_deciphered_sz))
|
&data_deciphered, &data_deciphered_sz))
|
||||||
{
|
{
|
||||||
if (data_deciphered)
|
if (data_deciphered)
|
||||||
|
|
Loading…
Reference in New Issue