]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Mtftp4Dxe: Add invalid ServerIp check during MTFTP configuration
authorJiaxin Wu <jiaxin.wu@intel.com>
Fri, 21 Apr 2017 02:15:27 +0000 (10:15 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Fri, 21 Apr 2017 05:06:16 +0000 (13:06 +0800)
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: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c

index 54942311660d4b4f4490edd951c62c1f236c5297..54384e143e2d290668c2d6687a7bc63d38309389 100644 (file)
@@ -2,7 +2,7 @@
   Interface routine for Mtftp4.\r
   \r
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -667,6 +667,10 @@ EfiMtftp4Configure (
     Gateway  = NTOHL (Gateway);\r
     ServerIp = NTOHL (ServerIp);\r
 \r
+    if (ServerIp == 0 || IP4_IS_LOCAL_BROADCAST (ServerIp)) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+\r
     if (!ConfigData->UseDefaultSetting &&\r
         ((!IP4_IS_VALID_NETMASK (Netmask) || (Netmask != 0 && !NetIp4IsUnicast (Ip, Netmask))))) {\r
 \r