From 04720d5ab9e7389f8a820fce05c8dcc036be6873 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Tue, 30 Dec 2014 04:08:59 +0000 Subject: [PATCH] Fix two important typo errors in Arrays. --- volatility/framework/objects/__init__.py | 2 ++ volatility/framework/symbols/vtypes.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/volatility/framework/objects/__init__.py b/volatility/framework/objects/__init__.py index 71646d916..605b7eec2 100644 --- a/volatility/framework/objects/__init__.py +++ b/volatility/framework/objects/__init__.py @@ -256,6 +256,8 @@ class Array(interfaces.objects.ObjectInterface, collections.Sequence): def __getitem__(self, i): """Returns the i-th item from the array""" + if i >= self._count or 0 > i: + raise IndexError return self._target(context = self._context, layer_name = self._layer_name, offset = self._offset + (self._target.size * i), parent = self) diff --git a/volatility/framework/symbols/vtypes.py b/volatility/framework/symbols/vtypes.py index 6e82e5d73..d4a3067aa 100644 --- a/volatility/framework/symbols/vtypes.py +++ b/volatility/framework/symbols/vtypes.py @@ -69,7 +69,7 @@ class VTypeSymbolTable(interfaces.symbols.SymbolTableInterface): # Add specific additional parameters, etc update = {} if structure_name == 'array': - update['count'] = dictionary[1], + update['count'] = dictionary[1] update['target'] = self._vtypedict_to_template(dictionary[2]) elif structure_name == 'pointer': update["target"] = self._vtypedict_to_template(dictionary[1])