[JPS] Improved processing of broken caches
If serialized metadata version has evidently incorrect size the module should be marked for rebuild prior to reading serialized version. #KT-42194 Fixed
This commit is contained in:
committed by
teamcityserver
parent
5d56bd545e
commit
4ad828f80f
+5
-1
@@ -39,7 +39,11 @@ class ModuleMapping private constructor(
|
||||
|
||||
fun readVersionNumber(stream: DataInputStream): IntArray? =
|
||||
try {
|
||||
IntArray(stream.readInt()) { stream.readInt() }
|
||||
val size = stream.readInt()
|
||||
if (size < 0 || size > BinaryVersion.MAX_LENGTH)
|
||||
null // cache is evidently corrupted
|
||||
else
|
||||
IntArray(size) { stream.readInt() }
|
||||
} catch (e: IOException) {
|
||||
null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user