From patchwork Fri Apr 22 08:32:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 66419 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp590790qge; Fri, 22 Apr 2016 01:33:23 -0700 (PDT) X-Received: by 10.66.146.196 with SMTP id te4mr26660119pab.125.1461314003229; Fri, 22 Apr 2016 01:33:23 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id d84si5751488pfd.66.2016.04.22.01.33.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Apr 2016 01:33:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A1E741A201F; Fri, 22 Apr 2016 01:33:22 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 524DC1A2010 for ; Fri, 22 Apr 2016 01:33:21 -0700 (PDT) Received: by mail-pf0-x235.google.com with SMTP id 184so39475156pff.0 for ; Fri, 22 Apr 2016 01:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Ouwr3OsvqNluw90Fmq4TUVl/WJzv9GRJy23o4WA2ZMQ=; b=kxYTgzEKB4wJtx69+GHpJ8QOwPJAwEWsfq8T9OFkWDq4D8RpgotmxPjnIh6zxHxNGB 50C1lgDBbWWWkxoTPALW4iy8E47z7YTZgyry4VumX6JosnrM8bq7arWjbKR/WfuEmIPJ 5SmPVdHZmasrjvY9q/BrfqJL7T+PdoNZzBkmw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ouwr3OsvqNluw90Fmq4TUVl/WJzv9GRJy23o4WA2ZMQ=; b=gxs3T/ZbLv7zxaBh0WPjwHDXa7AWeKsyLm3sOcPwoHGcrcsxJzs2jZfPJoDUNOhBAh PNa+dWjPuqB/eLU4bx1L+ujjKc/aVgoLUgb3cC+hg3li2aNI+mLhaPh0O5+JVDKTdFd7 IQtvsmp2TkeAPAxyIwNJz8luiaDKWhqkp+G4EIAP+i1NGrsUu0gks+2bvAQx/mtmQovj LpPDuJuEdvgtyI2kJ0J+HyaruKu3GrYPz0gMwhHNQ39RQL+4JsHqxZUZcVuGIraDMr+g EKyi+ONfVi7iDVZiw2CRZ05OS5J+B99rXVDaXqUTyADQeCUhYuD1mZRa3kbi7b4BX5nP guGg== X-Gm-Message-State: AOPr4FWIf8zGLMy8lsJvlHAVaL+mLoGnR3jJ/hFAmuP3cKtv69JLn7ZB1d3yGK3SFeNYIieF X-Received: by 10.98.11.78 with SMTP id t75mr26399945pfi.72.1461314000739; Fri, 22 Apr 2016 01:33:20 -0700 (PDT) Received: from localhost.localdomain ([104.238.45.92]) by smtp.gmail.com with ESMTPSA id 194sm6502818pfv.8.2016.04.22.01.33.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Apr 2016 01:33:20 -0700 (PDT) From: Heyi Guo To: edk2-devel@lists.01.org Date: Fri, 22 Apr 2016 16:32:47 +0800 Message-Id: <1461313967-15104-1-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.0 Subject: [edk2] [PATCH] MdeModulePkg/PXE: Avoid using overloaded BootFileName or ServerName X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: chenzhihui244@msn.com, Feng Tian , chenzhihui , Heyi Guo , Jiaxin Wu , Siyuan Fu , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" BootFileName or ServerName in DHCP offer may be overloaded and cannot be used, so we manually set the strings to be null to avoid misusing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: chenzhihui Signed-off-by: Heyi Guo Cc: Feng Tian Cc: Star Zeng Cc: Siyuan Fu Cc: Jiaxin Wu --- MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c index 6c06373..ecd1903 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c @@ -172,6 +172,8 @@ PxeBcParseCachedDhcpPacket ( ); } } + // Terminate the invalid string to avoid misusing + Offer->Dhcp4.Header.BootFileName[0] = 0; } if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_SERVER_NAME) != 0) { for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) { @@ -183,6 +185,8 @@ PxeBcParseCachedDhcpPacket ( ); } } + // Terminate the invalid string to avoid misusing + Offer->Dhcp4.Header.ServerName[0] = 0; } }