diff options
| -rw-r--r-- | sbat.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -70,24 +70,19 @@ error: EFI_STATUS parse_sbat(char *sbat_base, size_t sbat_size, struct sbat *sbat) { - CHAR8 *current = (CHAR8 *)sbat_base; - CHAR8 *end = (CHAR8 *)sbat_base + sbat_size; + CHAR8 *current = (CHAR8 *) sbat_base; + CHAR8 *end = (CHAR8 *) sbat_base + sbat_size - 1; EFI_STATUS efi_status = EFI_SUCCESS; struct sbat_entry *entry; struct sbat_entry **entries; unsigned int i; - while ((*current == '\r' || *current == '\n') && current < end) - current++; + if (!sbat_base || !sbat || sbat_size == 0) + return EFI_INVALID_PARAMETER; if (current == end) return EFI_INVALID_PARAMETER; - while ((*end == '\r' || *end == '\n') && end < current) - end--; - - *(end - 1) = '\0'; - do { entry = NULL; efi_status = parse_sbat_entry(¤t, end, &entry); |
