diff options
author | Patrick Wildt <patrick@blueri.se> | 2018-03-25 19:54:03 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2018-04-04 11:22:35 +0200 |
commit | eab2dc37ee457191583c5d9ff26ce9d7ccda3637 (patch) | |
tree | 7534bd16923673ca9e779e491e7523d0e13ace0d /lib | |
parent | e2742358661137b60eccd2e80b6835b58d8c5763 (diff) | |
download | u-boot-eab2dc37ee457191583c5d9ff26ce9d7ccda3637.zip u-boot-eab2dc37ee457191583c5d9ff26ce9d7ccda3637.tar.gz u-boot-eab2dc37ee457191583c5d9ff26ce9d7ccda3637.tar.bz2 |
efi_loader: initialize device path on alloc
Since the backing memory for a new device path can contain stale
data we have to make sure that we zero the buffer. Otherwise some
code paths that don't set all fields in a structure backed by this
device path might contain unwanted stale data.
Signed-off-by: Patrick Wildt <patrick@blueri.se>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 2262782..ab28b2f 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -66,6 +66,7 @@ static void *dp_alloc(size_t sz) return NULL; } + memset(buf, 0, sz); return buf; } |