mirror of https://github.com/acidanthera/audk.git
MdeModulePkg:Fix bug in function AsciiStrToIp4.
If a FQDN contains 3 dots '.' like "a.b.c.com", the AsciiStrToIp4 will return success as the HostName has a valid IP address. So we need to check if it is a decimal character before using AsciiStrDecimalToUintn. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
This commit is contained in:
parent
4962fcfa7d
commit
d82d59edb0
|
@ -2726,6 +2726,9 @@ NetLibAsciiStrToIp4 (
|
|||
TempStr = Ip4Str;
|
||||
|
||||
while ((*Ip4Str != '\0') && (*Ip4Str != '.')) {
|
||||
if (!NET_IS_DIGIT (*Ip4Str)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
Ip4Str++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue