jcricket / gwt-syncproxy

Provides Synchronous and Asynchronous access to GWT-RPC servlets from Java and Android
http://www.blueesoteric.com/open-source/gwt-syncproxy
Apache License 2.0
23 stars 14 forks source link

deconcat issue if string contains "])" #54

Open zorrozww opened 5 years ago

zorrozww commented 5 years ago

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