ieee1275: fix signed comparison

This commit is contained in:
Vladimir Serbinenko 2016-02-23 08:57:31 +01:00
parent 1b782e902e
commit 94c56a4c65

View file

@ -49,7 +49,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
sizeof available, &available_size))
return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
"couldn't examine /memory/available property");
if (available_size > sizeof (available))
if (available_size < 0 || (grub_size_t) available_size > sizeof (available))
return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
"/memory response buffer exceeded");