sbat: include NULL terminator when calculating buffer end in parse_sbat()

The parse_sbat() function is currently removing the last character of the
passed buffer, which will usually be a null-terminated string to parse.

There's no reason to do this and just take the whole size as specified by
the caller.

Reported-by: Chris Coulson <chris.coulson@canonical.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2021-02-17 14:03:01 +01:00 committed by Peter Jones
parent 496ca920ec
commit 4c9654fb68

2
sbat.c
View File

@ -89,7 +89,7 @@ EFI_STATUS
parse_sbat(char *sbat_base, size_t sbat_size, size_t *sbats, struct sbat_entry ***sbat)
{
CHAR8 *current = (CHAR8 *)sbat_base;
CHAR8 *end = (CHAR8 *)sbat_base + sbat_size - 1;
CHAR8 *end = (CHAR8 *)sbat_base + sbat_size;
EFI_STATUS efi_status = EFI_SUCCESS;
struct sbat_entry *entry = NULL;
struct sbat_entry **entries;