From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E36C721E2DA59 for ; Tue, 15 Aug 2017 23:16:53 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 15 Aug 2017 23:19:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,381,1498546800"; d="scan'208";a="140812743" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.167]) by fmsmga006.fm.intel.com with ESMTP; 15 Aug 2017 23:19:18 -0700 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Wu Jiaxin Date: Wed, 16 Aug 2017 14:19:17 +0800 Message-Id: <1502864357-18332-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [Patch] NetworkPkg/Ip6Dxe: Fix the bug when checking the DataSize X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2017 06:16:54 -0000 During setting the DnsServer, the DataSize check is incorrect. This patch is to fix the issue. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c index 61418e2..f4b9374 100644 --- a/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c +++ b/NetworkPkg/Ip6Dxe/Ip6ConfigImpl.c @@ -1464,11 +1464,11 @@ Ip6ConfigSetDnsServer ( OldDns = NULL; NewDns = NULL; Item = NULL; Tmp = NULL; - if ((DataSize == 0) && (DataSize % sizeof (EFI_IPv6_ADDRESS) != 0)) { + if ((DataSize != 0) && (DataSize % sizeof (EFI_IPv6_ADDRESS) != 0)) { return EFI_BAD_BUFFER_SIZE; } if (Instance->Policy != Ip6ConfigPolicyManual) { return EFI_WRITE_PROTECTED; -- 1.9.5.msysgit.1