From: Zac Medico Date: Sun, 4 May 2008 06:41:57 +0000 (-0000) Subject: Do more validation of resume data from the mtimedb. (trunk r10165) X-Git-Tag: v2.1.5~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f2028bc81c055b193f66f0bc4e73f3602f2cf3c1;p=portage.git Do more validation of resume data from the mtimedb. (trunk r10165) svn path=/main/branches/2.1.2/; revision=10166 --- diff --git a/bin/emerge b/bin/emerge index 2e9b0d0c2..75da6349c 100755 --- a/bin/emerge +++ b/bin/emerge @@ -7761,12 +7761,24 @@ def action_build(settings, trees, mtimedb, # validate the state of the resume data # so that we can make assumptions later. for k in ("resume", "resume_backup"): - if k in mtimedb: - if "mergelist" in mtimedb[k]: - if not mtimedb[k]["mergelist"]: - del mtimedb[k] - else: - del mtimedb[k] + if k not in mtimedb: + continue + resume_data = mtimedb[k] + if not isinstance(resume_data, dict): + del mtimedb[k] + continue + mergelist = resume_data.get("mergelist") + if not isinstance(mergelist, list): + del mtimedb[k] + continue + resume_opts = resume_data.get("myopts") + if not isinstance(resume_opts, (dict, list)): + del mtimedb[k] + continue + favorites = resume_data.get("favorites") + if not isinstance(resume_opts, list): + del mtimedb[k] + continue resume = False if "--resume" in myopts and \