gwt-syncproxy icon indicating copy to clipboard operation
gwt-syncproxy copied to clipboard

deconcat issue if string contains "])"

Open zorrozww opened this issue 5 years ago • 0 comments

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

zorrozww avatar Apr 15 '19 06:04 zorrozww