aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu Ken <ken.lu@intel.com>2022-07-13 10:06:11 +0800
committerDaniel Kiper <daniel.kiper@oracle.com>2022-07-27 19:12:26 +0200
commitef8679b645a63eb9eb191bb9539d7d25a9d6ff3b (patch)
tree296a09232136aee5f09231c1917dd65cb5fdb943
parent922898573e37135f5dedc16f3e15a1d1d4c53f8a (diff)
downloadgrub-ef8679b645a63eb9eb191bb9539d7d25a9d6ff3b.tar.gz
commands/efi/tpm: Use grub_strcpy() instead of grub_memcpy()
The event description is a string, so using grub_strcpy() is cleaner than using grub_memcpy(). Signed-off-by: Lu Ken <ken.lu@intel.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
-rw-r--r--grub-core/commands/efi/tpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c
index 7acf51049..bb5959972 100644
--- a/grub-core/commands/efi/tpm.c
+++ b/grub-core/commands/efi/tpm.c
@@ -175,7 +175,7 @@ grub_tpm1_log_event (grub_efi_handle_t tpm_handle, unsigned char *buf,
event->PCRIndex = pcr;
event->EventType = EV_IPL;
event->EventSize = grub_strlen (description) + 1;
- grub_memcpy (event->Event, description, event->EventSize);
+ grub_strcpy ((char *) event->Event, description);
algorithm = TCG_ALG_SHA;
status = efi_call_7 (tpm->log_extend_event, tpm, (grub_addr_t) buf, (grub_uint64_t) size,
@@ -212,7 +212,7 @@ grub_tpm2_log_event (grub_efi_handle_t tpm_handle, unsigned char *buf,
event->Header.EventType = EV_IPL;
event->Size =
sizeof (*event) - sizeof (event->Event) + grub_strlen (description) + 1;
- grub_memcpy (event->Event, description, grub_strlen (description) + 1);
+ grub_strcpy ((char *) event->Event, description);
status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (grub_addr_t) buf,
(grub_uint64_t) size, event);