<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">+ <a id="OWAAMEA661572DFC74983A7554CCF4CD8759BZ" href="mailto:gaoliming@byosoft.com.cn">
<span style="font-family:"Calibri",sans-serif;text-decoration:none">@Liming Gao</span></a></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- Bret <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:bret=corthon.com@groups.io">Bret Barkelew via groups.io</a><br>
<b>Sent: </b>Friday, April 9, 2021 11:25 AM<br>
<b>To: </b><a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>
<b>Cc: </b><a href="mailto:jian.j.wang@intel.com">Jian J Wang</a>; <a href="mailto:hao.a.wu@intel.com">
Hao A Wu</a><br>
<b>Subject: </b>[EXTERNAL] [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Initialize temp variable in VarCheckPolicyLib</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">DumpVariablePolicy() will return EFI_INVALID_PARAMETER if the Buffer<br>
pointer is NULL and the indirect Size is anything but 0. Since this<br>
TempSize was not being initialized it is very likely that this sequence<br>
would not return the total buffer size as expected.<br>
<br>
Bugzilla: <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3310&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C3d2f574a01a048aed60708d8fb84dcbb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637535895350828079%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=j6KmN6jcwoGJlunjspLawLJtYqCwGWw18pXNZVMNdC8%3D&amp;reserved=0">
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3310&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C3d2f574a01a048aed60708d8fb84dcbb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637535895350828079%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=j6KmN6jcwoGJlunjspLawLJtYqCwGWw18pXNZVMNdC8%3D&amp;reserved=0</a><br>
<br>
Cc: Jian J Wang <jian.j.wang@intel.com><br>
Cc: Hao A Wu <hao.a.wu@intel.com><br>
Signed-off-by: Bret Barkelew <bret.barkelew@microsoft.com><br>
---<br>
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c | 1 +<br>
 1 file changed, 1 insertion(+)<br>
<br>
diff --git a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c<br>
index 14e1904e96d3..e50edb4ffc5a 100644<br>
--- a/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c<br>
+++ b/MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c<br>
@@ -216,6 +216,7 @@ VarCheckPolicyLibMmiHandler (<br>
         DumpParamsOut->TotalSize = 0;<br>
         DumpParamsOut->PageSize = 0;<br>
         DumpParamsOut->HasMore = FALSE;<br>
+        TempSize = 0;<br>
         SubCommandStatus = DumpVariablePolicy (NULL, &TempSize);<br>
         if (SubCommandStatus == EFI_BUFFER_TOO_SMALL && TempSize > 0) {<br>
           mCurrentPaginationCommand = VAR_CHECK_POLICY_COMMAND_DUMP;<br>
-- <br>
2.28.0.windows.1<br>
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/73908">View/Reply Online (#73908)</a> |    |  <a target="_blank" href="https://groups.io/mt/81976547/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>