From 1bae0f26c994dbafbd2d8e4e08b0755f967e18c8 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Wed, 4 Apr 2018 00:40:30 +0100 Subject: [PATCH] Make sure we don't get in getattr loops. --- volatility/framework/interfaces/objects.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/volatility/framework/interfaces/objects.py b/volatility/framework/interfaces/objects.py index 50e0379ba..7b391d50f 100644 --- a/volatility/framework/interfaces/objects.py +++ b/volatility/framework/interfaces/objects.py @@ -1,12 +1,13 @@ """Objects are the core of volatility, and provide pythonic access to interpreted values of data from a layer. """ -import collections -import collections.abc import logging import typing from abc import ABCMeta, abstractmethod +import collections +import collections.abc + from volatility.framework import constants, validity, interfaces from volatility.framework.interfaces import context as interfaces_context @@ -24,6 +25,8 @@ class ReadOnlyMapping(validity.ValidityRoutines, collections.abc.Mapping): def __getattr__(self, attr: str) -> typing.Any: """Returns the item as an attribute""" + if attr == '_dict': + return super().__getattribute__(attr) if attr in self._dict: return self._dict[attr] raise AttributeError("Object has no attribute: {}.{}".format(self.__class__.__name__, attr))