Bug #301926 - Handle ValueError in parseManifest2(), triggered by corrupt
authorZac Medico <zmedico@gentoo.org>
Fri, 29 Jan 2010 18:50:06 +0000 (18:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 29 Jan 2010 18:50:06 +0000 (18:50 -0000)
manifest entry. (trunk r15207)

svn path=/main/branches/2.1.7/; revision=15259

pym/portage/manifest.py

index 40a8d77b69687d941ae6dc9376e5084d63ecb9f5..fc8afb4cf5bcfda8bcd3334910f08f7b70c1c82b 100644 (file)
@@ -59,7 +59,10 @@ def parseManifest2(mysplit):
        if len(mysplit) > 4 and mysplit[0] in portage.const.MANIFEST2_IDENTIFIERS:
                mytype = mysplit[0]
                myname = mysplit[1]
-               mysize = int(mysplit[2])
+               try:
+                       mysize = int(mysplit[2])
+               except ValueError:
+                       return None
                myhashes = dict(zip(mysplit[3::2], mysplit[4::2]))
                myhashes["size"] = mysize
                myentry = Manifest2Entry(type=mytype, name=myname, hashes=myhashes)