Skip to content

deconcat issue if string contains "])" #54

@zorrozww

Description

@zorrozww

Hi
I got a issue about concat.
If there's "])" in my string, for example "(XXX[XXX])", I will get a java.lang.StringIndexOutOfBoundsException.
Call stack
com.gdevelop.gwt.syncrpc.SyncClientSerializationStreamReader.parse(SyncClientSerializationStreamReader.java:783) com.gdevelop.gwt.syncrpc.SyncClientSerializationStreamReader.prepareToRead(SyncClientSerializationStreamReader.java:797)

I checked code and find the root cause.
In function "deconcat" (line 509 in SyncClientSerializationStreamReader.java)
end = encoded.indexOf(POSTLUDE, start)
It's trying to find the "])" to match the "concat([".
But if there's "])" in my string, it will get wrong.
For example
[1,0...].concat([...],0,7])
If there's no "])" in [...], everything works well.
But if I got [1,0...].concat([..."(XXX[XXX])",...],0,7])
function deconcat will return the broken string and cause function parse failed with exception.

Regards,
Zorro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions