Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7242bf1a authored by Ken Wakasa's avatar Ken Wakasa Committed by Android (Google) Code Review
Browse files

Merge "Make readHeader check the header size before using it."

parents 1e48fd03 b7bb9c97
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1683,13 +1683,14 @@ public final class BinaryDictInputOutput {
        final HashMap<String, String> attributes = new HashMap<String, String>();
        final int headerSize;
        headerSize = buffer.readInt();
        populateOptions(buffer, headerSize, attributes);
        buffer.position(headerSize);

        if (headerSize < 0) {
            throw new UnsupportedFormatException("header size can't be negative.");
        }

        populateOptions(buffer, headerSize, attributes);
        buffer.position(headerSize);

        final FileHeader header = new FileHeader(headerSize,
                new FusionDictionary.DictionaryOptions(attributes,
                        0 != (optionsFlags & FormatSpec.GERMAN_UMLAUT_PROCESSING_FLAG),