From: Paul Grimes <paul.grimes@amd.com>
In ProcessOpalRequest(), VariableSize is used prior to being
initialized. This change initializes the variable.
Cc: Qi Zhang <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Paul Grimes <paul.grimes@amd.com>
---
SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
index f127757ad9f0..d827cea23868 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
@@ -2184,6 +2184,7 @@ ProcessOpalRequest (
DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
+ VariableSize = 0;
if (mOpalRequestVariable == NULL) {
Status = GetVariable2 (
OPAL_REQUEST_VARIABLE_NAME,
--
2.24.0.windows.2
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95483): https://edk2.groups.io/g/devel/message/95483
Mute This Topic: https://groups.io/mt/94499443/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Paul via
> groups.io
> Sent: Sunday, October 23, 2022 12:00 AM
> To: devel@edk2.groups.io
> Cc: Zhang, Qi1 <qi1.zhang@intel.com>; Kumar, Rahul R
> <rahul.r.kumar@intel.com>
> Subject: [edk2-devel] [PATCH v1 2/2] SecurityPkg: OpalPasswordDxe:
> uninitialized local variable.
>
> From: Paul Grimes <paul.grimes@amd.com>
>
> In ProcessOpalRequest(), VariableSize is used prior to being
> initialized. This change initializes the variable.
>
> Cc: Qi Zhang <qi1.zhang@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Signed-off-by: Paul Grimes <paul.grimes@amd.com>
> ---
> SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> index f127757ad9f0..d827cea23868 100644
> --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c
> @@ -2184,6 +2184,7 @@ ProcessOpalRequest (
>
> DEBUG ((DEBUG_INFO, "%a() - enter\n", __FUNCTION__));
>
> + VariableSize = 0;
> if (mOpalRequestVariable == NULL) {
> Status = GetVariable2 (
> OPAL_REQUEST_VARIABLE_NAME,
> --
> 2.24.0.windows.2
>
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95611): https://edk2.groups.io/g/devel/message/95611
Mute This Topic: https://groups.io/mt/94499443/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.