Thanks for fixing this issue, Mike.
Reviewed-by: Nickle Wang <nick...@nvidia.com> Regards, Nickle > -----Original Message----- > From: Mike Maslenkin <mike.maslen...@gmail.com> > Sent: Tuesday, August 29, 2023 4:01 PM > To: devel@edk2.groups.io > Cc: abner.ch...@amd.com; Nickle Wang <nick...@nvidia.com>; > ig...@ami.com; Mike Maslenkin <mike.maslen...@gmail.com> > Subject: [PATCH v2 2/6] RedfishClientPkg: fix access to uninitialized variable > > External email: Use caution opening links or attachments > > > This patch fixes access to uninitialized variable, causing ASSERT from > FreePool at > least. > > Before this patch RedfishSettingsResponse was initialized by GetResourceByUri > under 'if (JsonValue != NULL)' condition. > But freed under 'if (Private->Payload != NULL)' condition. > Thus uninitialized pointers caused ASSERT on attempt to free memory. > > Signed-off-by: Mike Maslenkin <mike.maslen...@gmail.com> > --- > RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > index e7ac8779581c..f5562fb49cab 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > @@ -128,6 +128,8 @@ RedfishResourceConsumeResource ( > return Status; > > } > > > > + ZeroMem (&RedfishSettingsResponse, sizeof (REDFISH_RESPONSE)); > > + > > ExpectedResponse = &Response; > > RedfishSettingsUri = NULL; > > JsonValue = RedfishJsonInPayload (Response.Payload); > > -- > 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108106): https://edk2.groups.io/g/devel/message/108106 Mute This Topic: https://groups.io/mt/101027004/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-