summaryrefslogtreecommitdiff
path: root/shim.c
diff options
context:
space:
mode:
Diffstat (limited to 'shim.c')
-rw-r--r--shim.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/shim.c b/shim.c
index f743e8e2..533f5aa5 100644
--- a/shim.c
+++ b/shim.c
@@ -1293,10 +1293,12 @@ static EFI_STATUS handle_image (void *data, unsigned int datasize,
}
if (Section->SizeOfRawData > 0)
- CopyMem(base, data + Section->PointerToRawData, size);
+ CopyMem(base, data + Section->PointerToRawData,
+ Section->SizeOfRawData);
- if (size < Section->Misc.VirtualSize)
- ZeroMem(base + size, Section->Misc.VirtualSize - size);
+ if (Section->SizeOfRawData < Section->Misc.VirtualSize)
+ ZeroMem(base + Section->SizeOfRawData,
+ Section->Misc.VirtualSize - Section->SizeOfRawData);
}
}