Fix padding error in base read function.

This commit is contained in:
Mike Auty
2016-07-02 15:30:40 +01:00
parent 98fff4616c
commit 46190e37a9
+2 -1
View File
@@ -125,7 +125,8 @@ class TranslationLayerInterface(DataLayerInterface, metaclass = ABCMeta):
raise exceptions.LayerException("Mapping returned an overlapping element")
output += [self._context.memory.read(layer, mapped_offset, length, pad)]
current_offset += length
return b"".join(output)
recovered_data = b"".join(output)
return recovered_data + b"\x00" * (length - len(recovered_data))
def write(self, offset, value):
"""Writes a value at offset, distributing the writing across any underlying mapping"""