2011-09-15 Cedric Bail
* 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.
bytes_dictionary_entries = EET_FILE2_DICTIONARY_ENTRY_SIZE *
num_dictionary_entries;
- /* we can't have <= 0 values here - invalid */
- if (eet_test_close((num_directory_entries <= 0), ef))
+ /* we can't have > 0x7fffffff values here - invalid */
+ if (eet_test_close((num_directory_entries > 0x7fffffff), ef))
return NULL;
/* we can't have more bytes directory and bytes in dictionaries than the size of the file */
return NULL;
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 */
for (i = 0; i < num_directory_entries; ++i)
EXTRACT_INT(byte_entries, ef->data, idx);
/* 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;
/* we can't have more entires than minimum bytes for those! invalid! */
return NULL;
/* check we will not outrun the file limit */
- if (eet_test_close(((byte_entries + (int)sizeof(int) * 3) > ef->data_size),
- ef))
+ if (eet_test_close(((byte_entries + (int)(sizeof(int) * 3)) >
+ ef->data_size), ef))
return NULL;
/* allocate header */