[PATCH] tools: mkeficapsule: fill reserved members of structure

Fill reserved members of efi_firmware_management_capsule_image_header structure with zero's for safety.
Signed-off-by: AKASHI Takahiro takahiro.akashi@linaro.org Fixes: CID 316354 --- tools/mkeficapsule.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index 270943fc90ae..36f693f09644 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -310,6 +310,9 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid, image.version = 0x00000003; memcpy(&image.update_image_type_id, guid, sizeof(*guid)); image.update_image_index = index; + image.reserved[0] = 0; + image.reserved[1] = 0; + image.reserved[2] = 0; image.update_image_size = bin_stat.st_size; image.update_vendor_code_size = 0; /* none */ image.update_hardware_instance = instance;

On 1/22/21 2:43 AM, AKASHI Takahiro wrote:
Fill reserved members of efi_firmware_management_capsule_image_header structure with zero's for safety.
Signed-off-by: AKASHI Takahiro takahiro.akashi@linaro.org Fixes: CID 316354
Reviewed-by: Heinrich Schuchardt xypron.glpk@gmx.de
tools/mkeficapsule.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index 270943fc90ae..36f693f09644 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -310,6 +310,9 @@ static int create_fwbin(char *path, char *bin, efi_guid_t *guid, image.version = 0x00000003; memcpy(&image.update_image_type_id, guid, sizeof(*guid)); image.update_image_index = index;
- image.reserved[0] = 0;
- image.reserved[1] = 0;
- image.reserved[2] = 0; image.update_image_size = bin_stat.st_size; image.update_vendor_code_size = 0; /* none */ image.update_hardware_instance = instance;
participants (2)
-
AKASHI Takahiro
-
Heinrich Schuchardt