From: Patrick Wildt Date: Sun, 25 Mar 2018 17:54:03 +0000 (+0200) Subject: efi_loader: initialize device path on alloc X-Git-Tag: v2018.05-rc2~45^2~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eab2dc37ee457191583c5d9ff26ce9d7ccda3637;p=u-boot 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 Reviewed-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- 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; }