MdeModulePkg/DxeHttpLib: Avoid the pointless comparison of UINTN with zero
UINTN is unsigned integer, so it's pointless to compare it with zero. Cc: Bi Dandan <dandan.bi@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> 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: Zhang Lubo <lubo.zhang@intel.com>
This commit is contained in:
@ -736,7 +736,7 @@ HttpUrlGetPort (
|
|||||||
|
|
||||||
Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data);
|
Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data);
|
||||||
|
|
||||||
if (Data > HTTP_URI_PORT_MAX_NUM || Data < HTTP_URI_PORT_MIN_NUM) {
|
if (Data > HTTP_URI_PORT_MAX_NUM) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@ Header file for HttpLib.
|
|||||||
#define HTTP_URI_FIELD_PORT 7
|
#define HTTP_URI_FIELD_PORT 7
|
||||||
#define HTTP_URI_FIELD_MAX 8
|
#define HTTP_URI_FIELD_MAX 8
|
||||||
|
|
||||||
#define HTTP_URI_PORT_MIN_NUM 0
|
|
||||||
#define HTTP_URI_PORT_MAX_NUM 65535
|
#define HTTP_URI_PORT_MAX_NUM 65535
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user