public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Chen A Chen <chen.a.chen@intel.com>
To: edk2-devel@lists.01.org
Cc: Chen A Chen <chen.a.chen@intel.com>, Ruiyu Ni <ray.ni@intel.com>,
	Hao Wu <hao.a.wu@intel.com>
Subject: [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue
Date: Fri,  1 Feb 2019 10:21:27 +0800	[thread overview]
Message-ID: <20190201022127.10036-1-chen.a.chen@intel.com> (raw)

Uninitialized pointer variable may randomly point to a block of memory.
In This case, FreePool function will free a block of memory that is not
belongs to this function.

Cc: Ruiyu Ni <ray.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
---
 FatPkg/FatPei/Gpt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/FatPkg/FatPei/Gpt.c b/FatPkg/FatPei/Gpt.c
index c3afb668d7..bba33c5bfd 100644
--- a/FatPkg/FatPei/Gpt.c
+++ b/FatPkg/FatPei/Gpt.c
@@ -244,6 +244,9 @@ PartitionCheckGptEntryArray (
   UINTN                           Index2;
   EFI_PARTITION_ENTRY             *Entry;
 
+  PartitionEntryBuffer = NULL;
+  PartitionEntryStatus = NULL;
+
   ParentBlockDev  = &(PrivateData->BlockDevice[ParentBlockDevNo]);
   Found           = FALSE;
 
-- 
2.16.2.windows.1



             reply	other threads:[~2019-02-01  2:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-01  2:21 Chen A Chen [this message]
2019-02-02  5:20 ` [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190201022127.10036-1-chen.a.chen@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox