From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (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 2207E2205BE8F for ; Mon, 1 Jan 2018 22:22:34 -0800 (PST) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 02 Jan 2018 07:27:34 +0100 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Tue, 02 Jan 2018 06:27:03 +0000 Date: Tue, 2 Jan 2018 14:26:57 +0800 From: Gary Lin To: Fu Siyuan Cc: edk2-devel@lists.01.org, Ye Ting , Wang Fan , Wu Jiaxin Message-ID: <20180102062657.2ksvvd6gnr3toolo@GaryWorkstation> References: <20180102052744.9928-1-siyuan.fu@intel.com> <20180102052744.9928-3-siyuan.fu@intel.com> MIME-Version: 1.0 In-Reply-To: <20180102052744.9928-3-siyuan.fu@intel.com> User-Agent: NeoMutt/20170912 (1.9.0) Subject: Re: [Patch 2/5] NetworkPkg: Check allocated buffer pointer before use. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2018 06:22:35 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 02, 2018 at 01:27:41PM +0800, Fu Siyuan wrote: > Cc: Ye Ting > Cc: Wu Jiaxin > Cc: Wang Fan > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan > --- > NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c > index f2239fd8c0..327b4cf1cf 100644 > --- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c > +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp6.c > @@ -2,7 +2,7 @@ > Functions implementation related with DHCPv6 for UefiPxeBc Driver. > > (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> - Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> > This program and the accompanying materials > are licensed and made available under the terms and conditions of the BSD License > @@ -2030,6 +2030,9 @@ PxeBcDhcp6CallBack ( > SelectAd = &Private->OfferBuffer[Private->SelectIndex - 1].Dhcp6.Packet.Offer; > *NewPacket = AllocateZeroPool (SelectAd->Size); > ASSERT (*NewPacket != NULL); I guess this ASSERT can be removed since *NewPacket is checked later. Gary Lin > + if (*NewPacket == NULL) { > + return EFI_ABORTED; > + } > CopyMem (*NewPacket, SelectAd, SelectAd->Size); > } > break; > -- > 2.13.0.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >