Index: java/io/ObjectOutputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/ObjectOutputStream.java,v retrieving revision 1.71 diff -u -r1.71 ObjectOutputStream.java --- java/io/ObjectOutputStream.java 24 Dec 2006 20:45:06 -0000 1.71 +++ java/io/ObjectOutputStream.java 6 Feb 2007 07:37:48 -0000 @@ -1329,6 +1329,12 @@ { ObjectStreamField osf = fields[i]; Field field = osf.field; + + if (field == null) + throw new InvalidClassException("Missing field: " + osf.getName()); + + if (field.getType() != osf.getType()) + throw new InvalidClassException("Incorrect field type: " + osf.getName()); if (DEBUG && dump) dumpElementln ("WRITE FIELD: " + osf.getName() + " type=" + osf.getType());