Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
5.0M10
-
None
-
None
-
Patch Available
Description
I found there was a potential crash problem in StringReference command set, Value command. In the statement [1] as following shows, if the string object for which we are trying to read its ID has been GCed actually, the string ID we retrieved would be null as a result. Hence if we pass the null value to the follwing jni invocations [2], crash would happen. The solution is that we should return the error code to the upper level when the string object is GCed in this case.
[1] jstring stringObject = m_cmdParser->command.ReadStringID(jni);
[2] jsize len = jni->GetStringLength(stringObject);
jsize utfLen = jni->GetStringUTFLength(stringObject);