On 16.08.21 09:01, Christian Storm wrote: > From: Christian Storm <[email protected]> > > Memory allocated via AllocatePool() is not necessarily initialized > to zero. Hence, the buffer may contain random garbage after the > read custom FS label up to its \0-terminated end. > Explicitly use AllocateZeroPool() to avoid this issue. > > Signed-off-by: Christian Storm <[email protected]> > --- > utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/utils.c b/utils.c > index bd7b8d7..ba9239b 100644 > --- a/utils.c > +++ b/utils.c > @@ -82,7 +82,7 @@ CHAR16 *get_volume_custom_label(EFI_FILE_HANDLE fh) > { > EFI_STATUS status; > EFI_FILE_HANDLE tmp; > - CHAR16 *buffer = AllocatePool(64); > + CHAR16 *buffer = AllocateZeroPool(64); > UINTN buffsize = 63; > > status = uefi_call_wrapper( >
This also obsoletes the "buffer[buffsize] = L'\0'", right? Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/f016b849-e7b4-c1c1-0972-a9f67c6eee4e%40siemens.com.
