diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index ef19439a48..7700f0ff82 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -2726,6 +2726,9 @@ NetLibAsciiStrToIp4 ( TempStr = Ip4Str; while ((*Ip4Str != '\0') && (*Ip4Str != '.')) { + if (!NET_IS_DIGIT (*Ip4Str)) { + return EFI_INVALID_PARAMETER; + } Ip4Str++; }