undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com Patches, unit tests, benchmarks, whitepaper, and outreach briefs. Public domain — no copyright claimed. Use freely.
This commit is contained in:
commit
0a580b313d
70422 changed files with 17213626 additions and 0 deletions
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8202056
|
||||
* @compile/ref=SerialMethodArity.out -XDrawDiagnostics -Xlint:serial SerialMethodArity.java
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
|
||||
class SerialMethodMods implements Serializable {
|
||||
private static final long serialVersionUID = 42;
|
||||
|
||||
private static class CustomObjectOutputStream extends ObjectOutputStream {
|
||||
public CustomObjectOutputStream() throws IOException,
|
||||
SecurityException {}
|
||||
}
|
||||
|
||||
// Should have a single parameter of exact type ObjectOutputStream
|
||||
private void writeObject(CustomObjectOutputStream stream) throws IOException {
|
||||
stream.defaultWriteObject();
|
||||
}
|
||||
|
||||
// Should have a single parameter of exact type ObjectInputStream
|
||||
private void readObject(ObjectInputStream stream, int retries)
|
||||
throws IOException, ClassNotFoundException {
|
||||
stream.defaultReadObject();
|
||||
}
|
||||
|
||||
// Should have no arguments
|
||||
private void readObjectNoData(int retries) throws ObjectStreamException {}
|
||||
|
||||
// Should have no arguments
|
||||
public Object writeReplace(int arg0, int arg1) throws ObjectStreamException {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Should have no arguments
|
||||
public Object readResolve(double foo, float bar) throws ObjectStreamException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue