android-rcs / rcsjta

RCS-e stack for Android with GSMA API
173 stars 74 forks source link

Core: StringIndexOutOfBoundsException upon CPIM parsing #205

Closed yplo6403 closed 8 years ago

yplo6403 commented 8 years ago

Initial conditions : A and B with no established session Action: A sends a chat message having only space characters. Exepected result: B receives the chat message in the SIP invite. Result: An StringIndexOutOfBoundsException exception is raised by the core stack while parsing the CPIM message. Reproducible with TAPI 1.5 and 1.6 03-31 15:54:06.981 22681-22715/com.gsma.rcs V/[RCS][ImsServiceDispatcher]: Receive INVITE request 03-31 15:54:06.981 22681-22715/com.gsma.rcs V/[RCS][SipInterface]: >>> Send SIP 100 response 03-31 15:54:06.991 22681-22715/com.gsma.rcs E/[RCS][ImsServiceDispatcher]: Failed to dispatch received SIP request! CallId=fb1f75aa1e1782dbaa25951c04a5897d@172.20.65.107 03-31 15:54:06.991 22681-22715/com.gsma.rcs E/[RCS][ImsServiceDispatcher]: java.lang.StringIndexOutOfBoundsException: length=319; regionStart=262; regionLength=-263 at java.lang.String.startEndAndLength(String.java:504) at java.lang.String.substring(String.java:1333) at com.gsma.rcs.core.ims.service.im.chat.cpim.CpimParser.parse(CpimParser.java:105) at com.gsma.rcs.core.ims.service.im.chat.cpim.CpimParser.<init>(CpimParser.java:57) at com.gsma.rcs.core.ims.service.im.chat.ChatUtils.extractCpimMessage(ChatUtils.java:857) at com.gsma.rcs.core.ims.service.im.chat.ChatUtils.isFileTransferOverHttp(ChatUtils.java:902) at com.gsma.rcs.core.ims.service.ImsServiceDispatcher.dispatch(ImsServiceDispatcher.java:310) at com.gsma.rcs.core.ims.service.ImsServiceDispatcher.run(ImsServiceDispatcher.java:119) 03-31 15:54:17.441 22681-22731/com.gsma.rcs V/[RCS][ImsConnectionManager]: Polling: check IMS connection

yplo6403 commented 8 years ago

Bug fixed with commit 7f5d7ed7676e09804e63805db4de97bf1d1f0d86