mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
efi_loader: avoid buffer overrun in efi_var_mem_compare
We should not scan beyond the end of string name. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
093ff96e74
commit
67af329a74
1 changed files with 3 additions and 1 deletions
|
@ -41,11 +41,13 @@ efi_var_mem_compare(struct efi_var_entry *var, const efi_guid_t *guid,
|
|||
i < sizeof(efi_guid_t) && match; ++i)
|
||||
match = (guid1[i] == guid2[i]);
|
||||
|
||||
for (data = var->name, var_name = name;; ++data, ++var_name) {
|
||||
for (data = var->name, var_name = name;; ++data) {
|
||||
if (match)
|
||||
match = (*data == *var_name);
|
||||
if (!*data)
|
||||
break;
|
||||
if (*var_name)
|
||||
++var_name;
|
||||
}
|
||||
|
||||
++data;
|
||||
|
|
Loading…
Reference in a new issue