projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f12bcc9
)
efi_loader: check length in CreateDeviceNode()
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Mon, 22 Apr 2019 22:51:01 +0000
(
00:51
+0200)
committer
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Mon, 22 Apr 2019 22:51:01 +0000
(
00:51
+0200)
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>
lib/efi_loader/efi_device_path.c
patch
|
blob
|
history
diff --git
a/lib/efi_loader/efi_device_path.c
b/lib/efi_loader/efi_device_path.c
index 6104c7d33b70c2427af0e90e785e802942256b37..10f890f44f660153be523726dfc02b18a489a3bd 100644
(file)
--- a/
lib/efi_loader/efi_device_path.c
+++ b/
lib/efi_loader/efi_device_path.c
@@
-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;