From patchwork Mon Jun 25 18:15:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Palmer, Thomas" X-Patchwork-Id: 139876 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4294754lji; Mon, 25 Jun 2018 11:15:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLrQN4o3DhzOep6NGHbmyS+FKAsteIm+xQOyQ08I2Ln+VoKMcAFJFgDqE8bsuaAYkUdIs2v X-Received: by 2002:a63:7206:: with SMTP id n6-v6mr11484005pgc.174.1529950535104; Mon, 25 Jun 2018 11:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529950535; cv=none; d=google.com; s=arc-20160816; b=uwtpDu8cpCjhdpnNHF0NSlrZbIMsdh0Alx8z2dn3Yw7LFFGg2gHMdDDHZ+VVecIaFr 6v3NgwljOM0uaHELwDObPc+/I7NJdDPgC9FJpY9E6cJ3ELCntZkGY7Y0qhi4pbskg+92 Vw1IH8njNbum4xyvqFYshZuBFeHKI89rnZYJHJqTSOQOFFvHNOF7UE+EI4DM2aBAHdC9 3d/BuWlC5YIFrVVS7AViRjStEKd8XCuWY6fPc1l53wf5mWumb8s2s9JPpdKY7z7fJDVb FLRflW3VURr/ZAikPukqhkfL1W7KfqvaTewVdWrHOmTDXnN5nJfGD9/09miSJpSj9cAf qaEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=6kN+iUvcTMLYilPC6TejvVdBIBcj61toXVCqZ2OCp3c=; b=cgISTJOGaELhdCF/U01WuWdxCnGU9yVLZ49XXAxUEqOoTMAKHIFWUTwWljivCMNA6n mR9DX4PsCtT5dmz29UTOYgLvUoC2ysDM/Y7P2fuhKUjorNBKQzbo1LYddjUT8aQ9IB8Z 1a7MWWpfuDmQsonIGTzEmno+slKwQ45R4d85d+eGG4bZ0sqKdH14EoKRA/IN/8pI+F9N pngkciHtXJIzJXFxYAKqc3vDRhqvN/yHQN1AfuC7TY8xb/34eTR9sH+lTthk/AWD+/Ob 1Cplg+kijE3xmfNoKmMPIa8O8rHPRGzfyDTdBmNWOHgBfQ00pmpURzm/wGFacfwwjE9A iiwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id b1-v6si7190760pgb.465.2018.06.25.11.15.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 11:15:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 244BA202E5404; Mon, 25 Jun 2018 11:15:34 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.233.44.27; helo=g2t2354.austin.hpe.com; envelope-from=thomas.palmer@hpe.com; receiver=edk2-devel@lists.01.org Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) (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 ED295211F888F for ; Mon, 25 Jun 2018 11:15:32 -0700 (PDT) Received: from arm-build-server.us.rdlabs.hpecorp.net (arm-build-server.us.rdlabs.hpecorp.net [16.84.24.54]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 6849891; Mon, 25 Jun 2018 18:15:31 +0000 (UTC) From: Thomas Palmer To: edk2-devel@lists.01.org Date: Mon, 25 Jun 2018 13:15:18 -0500 Message-Id: <1529950518-16132-1-git-send-email-thomas.palmer@hpe.com> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ruiyu.ni@intel.com, hao.a.wu@intel.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" A single byte was allocate for a CHAR16 NUL terminator when instead two bytes should have been used. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Thomas Palmer --- Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Hao Wu diff --git a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c index 1516ab8d1c12..cfce4a0af345 100644 --- a/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c +++ b/Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c @@ -1,6 +1,7 @@ /**@file Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -453,7 +454,7 @@ Returns: ASSERT (PcdTempStr != NULL); TempStrSize = StrLen (PcdTempStr); - TempStr = AllocateMemory ((TempStrSize * sizeof (CHAR16)) + 1); + TempStr = AllocateMemory (((TempStrSize + 1) * sizeof (CHAR16))); StrCpy (TempStr, PcdTempStr); StartString = TempStr;