[Sablevm-developer] Deserialization of arrays of objects.
Brought to you by:
egagnon
From: James D. <jd...@ny...> - 2004-03-14 21:39:16
|
I ran into a bug in SableVM v1.0.9 on February second with deserialization of objects in arrays. The bug is still in v1.1.0, so I thought I'd resend my proposed fix, along with a simple testcase to show the bug. Basically, the deserialization code makes an assumption about the length of the classname in the bytestream that isn't correct for arrays of objects. The source code in the attached file, when compiled with Sun's JDK v1.3.1 throws "java.lang.ClassNotFoundException: Tryit$Inne at gnu.java.lang.SystemClassLoader.findClass (SystemClassLoader.java:79)" when run under SableVM v1.1.0 (Debian testing). I haven't tested the following "obvious" diff (I don't have the sources installed), but it shows what I *think* is the offending line of code. I'm sorry that I can't submit a fully tested patch, but I'm tainted (I've read Sun's source), so this is the closest I dare come. I'd be happy to take whatever steps are suggested to help debug this issue, however. --- ClassLoader.java Fri Feb 6 22:45:56 2004 +++ ClassLoader.java-patched Fri Feb 6 22:46:09 2004 @@ -365,7 +365,7 @@ case 'L': { - elementName = elementName.substring (1, elementName.length() - 1); + elementName = elementName.substring (1, elementName.length()); element = loadClass (elementName, resolve); } break; James Damour |