summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path.c
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@blueri.se>2018-03-25 19:54:03 +0200
committerAlexander Graf <agraf@suse.de>2018-04-04 11:22:35 +0200
commiteab2dc37ee457191583c5d9ff26ce9d7ccda3637 (patch)
tree7534bd16923673ca9e779e491e7523d0e13ace0d /lib/efi_loader/efi_device_path.c
parente2742358661137b60eccd2e80b6835b58d8c5763 (diff)
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/efi_loader/efi_device_path.c')
-rw-r--r--lib/efi_loader/efi_device_path.c1
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 22627824f0..ab28b2fd25 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;
}