Skip to content
This repository was archived by the owner on Apr 27, 2024. It is now read-only.
This repository was archived by the owner on Apr 27, 2024. It is now read-only.

SNBT Parsing #24

@katietheqt-old

Description

@katietheqt-old

It seems like the SNBT parser is very unreliable. Some inputs cause it to hang, and it returns incorrect data for other inputs.

For example, the perfectly valid SNBT {"a":{}} hangs the SNBT parser until it consumes all available Java heap space and throws an OutOfMemoryError, as in the below code:

InputStream is = new ByteArrayInputStream("{\"a\":{}}".getBytes(StandardCharsets.UTF_8));

try (SNBTIO.StringifiedNBTReader reader = new SNBTIO.StringifiedNBTReader(is)) {
    reader.readNextTag("");
} catch (IOException e) {
    // Input is a BAIS so this *should* never fail.
    throw new AssertionError(e);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions