Ensure we only write as much data as is required.

This commit is contained in:
Mike Auty
2019-08-25 13:25:01 +01:00
parent e6125b5df6
commit 52b339d0fa
+2 -1
View File
@@ -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