From 9d8b614097cc94a30b894d88fefb37195fbffcbf Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 10 Apr 2023 18:01:47 +0200 Subject: [PATCH] Handle classes with nil superclass. Ie. java.lang.Object. --- classfile/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classfile/file.py b/classfile/file.py index d361b47..819c6a4 100644 --- a/classfile/file.py +++ b/classfile/file.py @@ -637,7 +637,7 @@ class classfile(object): self.super = buf.uint16() if not self.checkcp(self.this, classref): raise binfmt.fmterror("invalid class name reference") - if not self.checkcp(self.super, classref): + if not self.checkcp(self.super, classref) and self.cp[self.super] is not None: raise binfmt.fmterror("invalid super-class reference") iflen = buf.uint16() while len(self.ifaces) < iflen: -- 2.11.0