MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to
return the correct status for the HTTP Port/ContentLength.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Jiaxin Wu 2017-02-08 11:56:54 +08:00
parent 9fe9cf9acb
commit 27fd61af01
1 changed files with 3 additions and 5 deletions

View File

@ -2,7 +2,7 @@
This library is used to share code between UEFI network stack modules. This library is used to share code between UEFI network stack modules.
It provides the helper routines to parse the HTTP message byte stream. It provides the helper routines to parse the HTTP message byte stream.
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -721,9 +721,8 @@ HttpUrlGetPort (
} }
PortString[ResultLength] = '\0'; PortString[ResultLength] = '\0';
*Port = (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
return EFI_SUCCESS; return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port);
} }
/** /**
@ -932,8 +931,7 @@ HttpIoParseContentLengthHeader (
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
*ContentLength = AsciiStrDecimalToUintn (Header->FieldValue); return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, ContentLength);
return EFI_SUCCESS;
} }
/** /**