mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Make readHeader check the header size before using it.
Change-Id: I5dc3e2b674f7343ef57317fde6bdb7349a7fe04c
This commit is contained in:
parent
e8264cab71
commit
b7bb9c9722
@ -1683,13 +1683,14 @@ public final class BinaryDictInputOutput {
|
|||||||
final HashMap<String, String> attributes = new HashMap<String, String>();
|
final HashMap<String, String> attributes = new HashMap<String, String>();
|
||||||
final int headerSize;
|
final int headerSize;
|
||||||
headerSize = buffer.readInt();
|
headerSize = buffer.readInt();
|
||||||
populateOptions(buffer, headerSize, attributes);
|
|
||||||
buffer.position(headerSize);
|
|
||||||
|
|
||||||
if (headerSize < 0) {
|
if (headerSize < 0) {
|
||||||
throw new UnsupportedFormatException("header size can't be negative.");
|
throw new UnsupportedFormatException("header size can't be negative.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
populateOptions(buffer, headerSize, attributes);
|
||||||
|
buffer.position(headerSize);
|
||||||
|
|
||||||
final FileHeader header = new FileHeader(headerSize,
|
final FileHeader header = new FileHeader(headerSize,
|
||||||
new FusionDictionary.DictionaryOptions(attributes,
|
new FusionDictionary.DictionaryOptions(attributes,
|
||||||
0 != (optionsFlags & FormatSpec.GERMAN_UMLAUT_PROCESSING_FLAG),
|
0 != (optionsFlags & FormatSpec.GERMAN_UMLAUT_PROCESSING_FLAG),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user