Skip to content

Repeated, long SD causes BufferOverflow #21

@StrongestNumber9

Description

@StrongestNumber9

Something like

        StringBuilder x = new StringBuilder();
        String key = new String(new char[32]).replace("\0", "X");
        String value = new String(new char[32]).replace("\0", "X");
        sdSubscription.subscribeElement("id@0", key);
        for(int i=0; i<=1000; i++) {
            x.append("[id@0 ").append(key).append("=\"").append(value).append("\"]");
        }
        String input = x+"[id@0 keyHere=\"valueThere\"] ";

causes

java.nio.BufferOverflowException
        at java.base/java.nio.Buffer.nextPutIndex(Buffer.java:722)
        at java.base/java.nio.DirectByteBuffer.put(DirectByteBuffer.java:352)
        at com.teragrep.rlo_06.StructuredData.accept(StructuredData.java:163)
        at com.teragrep.rlo_06.StructuredDataTest.longSD(StructuredDataTest.java:64)

Stacktrace truncated as it is from junit

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