Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,13 @@ public static byte[] serialize(Object obj) throws IOException {
}

public static Object deserialize(byte[] bytes)
throws IOException, ClassNotFoundException {
try (ByteArrayInputStream b = new ByteArrayInputStream(bytes)) {
try (ObjectInputStream o = new ObjectInputStream(b)) {
return o.readObject();
}
}
throws IOException, ClassNotFoundException {
try (ByteArrayInputStream b = new ByteArrayInputStream(bytes);
ValidatingObjectInputStream o = new ValidatingObjectInputStream(b)) {
// Only allow specific classes to be deserialized
o.accept(LinkedList.class, LogMutation.class, HashMap.class, String.class);
return o.readObject();
}
}

}
Loading