Re: [edk2] [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port number.
Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -Original Message- > From: Zhang, Lubo > Sent: Thursday, March 16, 2017 3:09 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, > Jiaxin > Subject: [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port > number. > > Http boot on X64 platform is faild, this is caused by the incorrect > type conversion when getting port number from Url. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Zhang Lubo > Cc: Ye Ting > Cc: Fu Siyuan > Cc: Wu Jiaxin > --- > MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c > b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c > index ccc20cc..2ff04ff 100644 > --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c > +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c > @@ -690,10 +690,11 @@ HttpUrlGetPort ( > OUT UINT16 *Port >) > { >CHAR8 *PortString; >EFI_STATUSStatus; > + UINTN Data; >UINT32ResultLength; >HTTP_URL_PARSER *Parser; > >if (Url == NULL || UrlParser == NULL || Port == NULL) { > return EFI_INVALID_PARAMETER; > @@ -720,11 +721,14 @@ HttpUrlGetPort ( > return Status; >} > >PortString[ResultLength] = '\0'; > > - return AsciiStrDecimalToUintnS (Url + Parser- > >FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) > Port); > + Status = AsciiStrDecimalToUintnS (Url + Parser- > >FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data); > + > + *Port = (UINT16) Data; > + return Status; > } > > /** >Get the Path from a HTTP URL. > > -- > 1.9.5.msysgit.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port number.
Reviewed-by: Fu Siyuan -Original Message- From: Zhang, Lubo Sent: 2017年3月16日 15:09 To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin Subject: [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port number. Http boot on X64 platform is faild, this is caused by the incorrect type conversion when getting port number from Url. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin --- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c index ccc20cc..2ff04ff 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -690,10 +690,11 @@ HttpUrlGetPort ( OUT UINT16 *Port ) { CHAR8 *PortString; EFI_STATUSStatus; + UINTN Data; UINT32ResultLength; HTTP_URL_PARSER *Parser; if (Url == NULL || UrlParser == NULL || Port == NULL) { return EFI_INVALID_PARAMETER; @@ -720,11 +721,14 @@ HttpUrlGetPort ( return Status; } PortString[ResultLength] = '\0'; - return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port); + Status = AsciiStrDecimalToUintnS (Url + + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, + &Data); + + *Port = (UINT16) Data; + return Status; } /** Get the Path from a HTTP URL. -- 1.9.5.msysgit.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] [patch] MdeModulePkg: Fix bug in DxeHttplib when converting port number.
Http boot on X64 platform is faild, this is caused by the incorrect type conversion when getting port number from Url. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo Cc: Ye Ting Cc: Fu Siyuan Cc: Wu Jiaxin --- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c index ccc20cc..2ff04ff 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -690,10 +690,11 @@ HttpUrlGetPort ( OUT UINT16 *Port ) { CHAR8 *PortString; EFI_STATUSStatus; + UINTN Data; UINT32ResultLength; HTTP_URL_PARSER *Parser; if (Url == NULL || UrlParser == NULL || Port == NULL) { return EFI_INVALID_PARAMETER; @@ -720,11 +721,14 @@ HttpUrlGetPort ( return Status; } PortString[ResultLength] = '\0'; - return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port); + Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data); + + *Port = (UINT16) Data; + return Status; } /** Get the Path from a HTTP URL. -- 1.9.5.msysgit.1 ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel