mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8203368: ObjectInputStream filterCheck method throws NullPointerException
Reviewed-by: bpb, smarks
This commit is contained in:
parent
5634c779d5
commit
474a1253bb
2 changed files with 127 additions and 2 deletions
|
@ -1263,9 +1263,11 @@ public class ObjectInputStream
|
|||
if (serialFilter != null) {
|
||||
RuntimeException ex = null;
|
||||
ObjectInputFilter.Status status;
|
||||
// Info about the stream is not available if overridden by subclass, return 0
|
||||
long bytesRead = (bin == null) ? 0 : bin.getBytesRead();
|
||||
try {
|
||||
status = serialFilter.checkInput(new FilterValues(clazz, arrayLength,
|
||||
totalObjectRefs, depth, bin.getBytesRead()));
|
||||
totalObjectRefs, depth, bytesRead));
|
||||
} catch (RuntimeException e) {
|
||||
// Preventive interception of an exception to log
|
||||
status = ObjectInputFilter.Status.REJECTED;
|
||||
|
@ -1277,7 +1279,7 @@ public class ObjectInputStream
|
|||
? Logger.Level.DEBUG
|
||||
: Logger.Level.TRACE,
|
||||
"ObjectInputFilter {0}: {1}, array length: {2}, nRefs: {3}, depth: {4}, bytes: {5}, ex: {6}",
|
||||
status, clazz, arrayLength, totalObjectRefs, depth, bin.getBytesRead(),
|
||||
status, clazz, arrayLength, totalObjectRefs, depth, bytesRead,
|
||||
Objects.toString(ex, "n/a"));
|
||||
}
|
||||
if (status == null ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue