mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 22:20:45 +00:00
efi_loader: check length in CreateDeviceNode()
When creating a device path node ensure that the size of the allocated memory at lest matches the size of the node header. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
f12bcc9149
commit
7d1e4b73e3
1 changed files with 3 additions and 0 deletions
|
@ -335,6 +335,9 @@ struct efi_device_path *efi_dp_create_device_node(const u8 type,
|
|||
{
|
||||
struct efi_device_path *ret;
|
||||
|
||||
if (length < sizeof(struct efi_device_path))
|
||||
return NULL;
|
||||
|
||||
ret = dp_alloc(length);
|
||||
if (!ret)
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue