8272236: Improve serial forms for transport

Reviewed-by: bchristi, rhalade, smarks
This commit is contained in:
Roger Riggs 2021-09-03 19:10:21 +00:00 committed by Henry Jen
parent aa28430bdd
commit 3adc111766

View file

@ -2566,6 +2566,13 @@ public class ObjectInputStream
throw new InternalError();
}
clear();
// Check that an object follows the TC_EXCEPTION typecode
byte tc = bin.peekByte();
if (tc != TC_OBJECT &&
tc != TC_REFERENCE) {
throw new StreamCorruptedException(
String.format("invalid type code: %02X", tc));
}
return (IOException) readObject0(Object.class, false);
}