public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Thomas Palmer <thomas.palmer@hpe.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "garyli@hpe.com" <garyli@hpe.com>,
	"joseph.shifflett@hpe.com" <joseph.shifflett@hpe.com>,
	"Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size
Date: Tue, 26 Jun 2018 00:51:09 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A0931E0AFF4@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1529950518-16132-1-git-send-email-thomas.palmer@hpe.com>

Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: Thomas Palmer [mailto:thomas.palmer@hpe.com]
> Sent: Tuesday, June 26, 2018 2:15 AM
> To: edk2-devel@lists.01.org
> Cc: garyli@hpe.com; joseph.shifflett@hpe.com; Ni, Ruiyu; Wu, Hao A; Thomas
> Palmer
> Subject: [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size
> 
> 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 <thomas.palmer@hpe.com>
> ---
>  Nt32Pkg/WinNtBusDriverDxe/WinNtBusDriver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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.<BR>
> +(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
>  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;
> --
> 2.7.4



  reply	other threads:[~2018-06-26  0:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 18:15 [PATCH 1/1] Nt32Pkg/WinNtBusDriverDxe: Fix memory allocation size Thomas Palmer
2018-06-26  0:51 ` Wu, Hao A [this message]
2018-06-27  1:04   ` Wu, Hao A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B80AF82E9BFB8E4FBD8C89DA810C6A0931E0AFF4@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox