[edk2-devel] [PATCH v2 1/3] ShellPkg/HttpDynamicCommand: Fix possible uninitialized use

Gao, Zhichao zhichao.gao at intel.com
Wed May 19 02:21:05 UTC 2021


Reviewed-by: Zhichao Gao <zhichao.gao at intel.com>

Thanks,
Zhichao

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of
> gaoliming
> Sent: Wednesday, May 19, 2021 9:13 AM
> To: devel at edk2.groups.io; sergei at posteo.net
> Cc: Ni, Ray <ray.ni at intel.com>; Gao, Zhichao <zhichao.gao at intel.com>
> Subject: 回复: [edk2-devel] [PATCH v2 1/3] ShellPkg/HttpDynamicCommand:
> Fix possible uninitialized use
> 
> Reviewed-by: Liming Gao <gaoliming at byosoft.com.cn>
> 
> This fix is clear.
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: devel at edk2.groups.io <devel at edk2.groups.io> 代表 Sergei
> Dmitrouk
> > 发送时间: 2021年5月19日 0:10
> > 收件人: devel at edk2.groups.io
> > 抄送: Ray Ni <ray.ni at intel.com>; Zhichao Gao <zhichao.gao at intel.com>
> > 主题: [edk2-devel] [PATCH v2 1/3] ShellPkg/HttpDynamicCommand: Fix
> > possible uninitialized use
> >
> > `Status` can be used uninitialized:
> >
> >     /* Evaluates to FALSE */
> >     if (ShellGetExecutionBreakFlag ()) {
> >         Status = EFI_ABORTED;
> >         break;
> >     }
> >
> >     /* Evaluates to FALSE */
> >     if (!Context->ContentDownloaded && !Context->ResponseToken.Event)
> {
> >         Status = ...;
> >         ASSERT_EFI_ERROR (Status);
> >     } else {
> >         ResponseMessage.Data.Response = NULL;
> >     }
> >
> >     /* UNINITIALIZED USE */
> >     if (EFI_ERROR (Status)) {
> >         break;
> >     }
> >
> > Cc: Ray Ni <ray.ni at intel.com>
> > Cc: Zhichao Gao <zhichao.gao at intel.com>
> > Signed-off-by: Sergei Dmitrouk <sergei at posteo.net>
> > ---
> >  ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c
> > b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c
> > index 3735a4a7e645..7b9b2d238015 100644
> > --- a/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c
> > +++ b/ShellPkg/DynamicCommand/HttpDynamicCommand/Http.c
> > @@ -1524,6 +1524,7 @@ GetResponse (
> >    Context->ResponseToken.Message = &ResponseMessage;
> >    Context->ContentLength = 0;
> >    Context->Status = REQ_OK;
> > +  Status = EFI_SUCCESS;
> >    MsgParser = NULL;
> >    ResponseData.StatusCode = HTTP_STATUS_UNSUPPORTED_STATUS;
> >    ResponseMessage.Data.Response = &ResponseData;
> > --
> > 2.17.6
> >
> >
> >
> >
> >
> 
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75302): https://edk2.groups.io/g/devel/message/75302
Mute This Topic: https://groups.io/mt/82927931/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list