From: Michael Brown Date: Wed, 29 Jun 2016 14:13:35 +0000 (+0100) Subject: [efi] Fix uninitialised data in HII IFR structures X-Git-Tag: v1.20.1~412 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f6a8605955926017cdbe2fa99a4b72fd0985a2;p=thirdparty%2Fipxe.git [efi] Fix uninitialised data in HII IFR structures The HII IFR structures are allocated via realloc() rather than zalloc(), and so are not automatically zeroed. This results in the presence of uninitialised and invalid data, causing crashes elsewhere in the UEFI firmware. Fix by explicitly zeroing the newly allocated portion of any IFR structure in efi_ifr_op(). Debugged-by: Laszlo Ersek Debugged-by: Gary Lin Signed-off-by: Michael Brown --- diff --git a/src/interface/efi/efi_hii.c b/src/interface/efi/efi_hii.c index 0ea970e67..506fc8869 100644 --- a/src/interface/efi/efi_hii.c +++ b/src/interface/efi/efi_hii.c @@ -117,6 +117,7 @@ static void * efi_ifr_op ( struct efi_ifr_builder *ifr, unsigned int opcode, ifr->ops_len = new_ops_len; /* Fill in opcode header */ + memset ( op, 0, len ); op->OpCode = opcode; op->Length = len;