From 52b339d0fa1f0358a3ea669ff5233feffaa89d52 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 25 Aug 2019 13:23:26 +0100 Subject: [PATCH] Ensure we only write as much data as is required. --- volatility/framework/interfaces/layers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/volatility/framework/interfaces/layers.py b/volatility/framework/interfaces/layers.py index d636da1d9..4d3b80d23 100644 --- a/volatility/framework/interfaces/layers.py +++ b/volatility/framework/interfaces/layers.py @@ -404,7 +404,8 @@ class TranslationLayerInterface(DataLayerInterface, metaclass = ABCMeta): self.name, current_offset, "Layer {} cannot map offset: {}".format(self.name, current_offset)) elif offset < current_offset: raise exceptions.LayerException(self.name, "Mapping returned an overlapping element") - self._context.layers.write(layer, mapped_offset, value) + self._context.layers.write(layer, mapped_offset, value[:length]) + value = value[length:] current_offset += length # ## Scan implementation with knowledge of pages