From: Zac Medico Date: Tue, 20 May 2008 01:13:25 +0000 (-0000) Subject: Inside vardbapi.aux_get(), do more validation on the cache data to X-Git-Tag: v2.2_pre7~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e91945cd3bb16a6a6d4c8e11d43891bd4b4fc2b1;p=portage.git Inside vardbapi.aux_get(), do more validation on the cache data to ensure it contains the expected data types. svn path=/main/trunk/; revision=10373 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index cb47cd68d..fc0fca28d 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -617,6 +617,15 @@ class vardbapi(dbapi): cache_incomplete = False cache_mtime = None metadata = None + if pkg_data is not None: + if not isinstance(pkg_data, tuple) or len(pkg_data) != 2: + pkg_data = None + else: + cache_mtime, metadata = pkg_data + if not isinstance(cache_mtime, (long, int)) or \ + not isinstance(metadata, dict): + pkg_data = None + if pkg_data: cache_mtime, metadata = pkg_data cache_valid = cache_mtime == mydir_mtime