forked from enlightenment/efl
FIX: allow open of eet files with 0 key entries. this kind of breaks
some usage scenarios. SVN revision: 63800
This commit is contained in:
parent
8edb994133
commit
4376c4f995
|
@ -530,3 +530,8 @@
|
||||||
2011-09-15 Cedric Bail
|
2011-09-15 Cedric Bail
|
||||||
|
|
||||||
* Add eet_data_xattr_cipher_get and eet_data_xattr_cipher_set.
|
* Add eet_data_xattr_cipher_get and eet_data_xattr_cipher_set.
|
||||||
|
|
||||||
|
2011-10-04 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Fix issue where an empty eet file (no keys) is not openable
|
||||||
|
for read/write anymore. Allow it.
|
||||||
|
|
|
@ -882,8 +882,8 @@ eet_internal_read2(Eet_File *ef)
|
||||||
bytes_dictionary_entries = EET_FILE2_DICTIONARY_ENTRY_SIZE *
|
bytes_dictionary_entries = EET_FILE2_DICTIONARY_ENTRY_SIZE *
|
||||||
num_dictionary_entries;
|
num_dictionary_entries;
|
||||||
|
|
||||||
/* we can't have <= 0 values here - invalid */
|
/* we can't have > 0x7fffffff values here - invalid */
|
||||||
if (eet_test_close((num_directory_entries <= 0), ef))
|
if (eet_test_close((num_directory_entries > 0x7fffffff), ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* we can't have more bytes directory and bytes in dictionaries than the size of the file */
|
/* we can't have more bytes directory and bytes in dictionaries than the size of the file */
|
||||||
|
@ -912,6 +912,10 @@ eet_internal_read2(Eet_File *ef)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
signature_base_offset = 0;
|
signature_base_offset = 0;
|
||||||
|
if (num_directory_entries == 0)
|
||||||
|
{
|
||||||
|
signature_base_offset = ef->data_size;
|
||||||
|
}
|
||||||
|
|
||||||
/* actually read the directory block - all of it, into ram */
|
/* actually read the directory block - all of it, into ram */
|
||||||
for (i = 0; i < num_directory_entries; ++i)
|
for (i = 0; i < num_directory_entries; ++i)
|
||||||
|
@ -1134,7 +1138,8 @@ eet_internal_read1(Eet_File *ef)
|
||||||
EXTRACT_INT(byte_entries, ef->data, idx);
|
EXTRACT_INT(byte_entries, ef->data, idx);
|
||||||
|
|
||||||
/* we can't have <= 0 values here - invalid */
|
/* we can't have <= 0 values here - invalid */
|
||||||
if (eet_test_close((num_entries <= 0) || (byte_entries <= 0), ef))
|
if (eet_test_close((num_entries > 0x7fffffff) ||
|
||||||
|
(byte_entries > 0x7fffffff), ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* we can't have more entires than minimum bytes for those! invalid! */
|
/* we can't have more entires than minimum bytes for those! invalid! */
|
||||||
|
@ -1142,8 +1147,8 @@ eet_internal_read1(Eet_File *ef)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* check we will not outrun the file limit */
|
/* check we will not outrun the file limit */
|
||||||
if (eet_test_close(((byte_entries + (int)sizeof(int) * 3) > ef->data_size),
|
if (eet_test_close(((byte_entries + (int)(sizeof(int) * 3)) >
|
||||||
ef))
|
ef->data_size), ef))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* allocate header */
|
/* allocate header */
|
||||||
|
|
Loading…
Reference in New Issue