public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ye, Ting" <ting.ye@intel.com>
To: "Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"Fu, Siyuan" <siyuan.fu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zhang, Lubo" <lubo.zhang@intel.com>
Subject: Re: [Patch 2/2] NetworkPkg: Check for NULL pointer before dereference it.
Date: Mon, 31 Oct 2016 07:35:45 +0000	[thread overview]
Message-ID: <BC0C045B0E2A584CA4575E779FA2C12A17E92E19@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <895558F6EA4E3B41AC93A00D163B7274138A0D0F@SHSMSX103.ccr.corp.intel.com>

Reviewed-by: Ye Ting <ting.ye@intel.com>


-----Original Message-----
From: Wu, Jiaxin 
Sent: Monday, October 31, 2016 3:23 PM
To: Fu, Siyuan <siyuan.fu@intel.com>; edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Zhang, Lubo <lubo.zhang@intel.com>
Subject: RE: [Patch 2/2] NetworkPkg: Check for NULL pointer before dereference it.

Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>

Best Regards!
Jiaxin

> -----Original Message-----
> From: Fu, Siyuan
> Sent: Monday, October 31, 2016 10:23 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Zhang, Lubo <lubo.zhang@intel.com>; 
> Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [Patch 2/2] NetworkPkg: Check for NULL pointer before dereference it.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> index 52095c5..0552174 100644
> --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> @@ -2013,10 +2013,14 @@ EfiPxeBcSetStationIP (
>      return EFI_INVALID_PARAMETER;
>    }
> 
> -  if (!Mode->UsingIpv6 && NewStationIp != NULL && !NetIp4IsUnicast 
> (NTOHL (NewStationIp->Addr[0]), NTOHL (NewSubnetMask->Addr[0]))) {
> -    return EFI_INVALID_PARAMETER;
> +  if (!Mode->UsingIpv6 && NewStationIp != NULL) {
> +    if (IP4_IS_UNSPECIFIED(NTOHL (NewStationIp->Addr[0])) ||
> +        IP4_IS_LOCAL_BROADCAST(NTOHL (NewStationIp->Addr[0])) ||
> +        (NewSubnetMask != NULL && !NetIp4IsUnicast (NTOHL 
> + (NewStationIp-
> >Addr[0]), NTOHL (NewSubnetMask->Addr[0])))) {
> +      return EFI_INVALID_PARAMETER;
> +    }
>    }
> -
> +
>    if (!Mode->Started) {
>      return EFI_NOT_STARTED;
>    }
> --
> 2.7.4.windows.1



      reply	other threads:[~2016-10-31  7:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31  2:22 [Patch 0/2] Check for NULL pointer before dereference Fu Siyuan
2016-10-31  2:23 ` [Patch 1/2] MdeModulePkg: Check for NULL pointer before dereference it Fu Siyuan
2016-10-31  7:22   ` Wu, Jiaxin
2016-10-31  7:29     ` Fu, Siyuan
2016-10-31  7:35       ` Ye, Ting
2016-10-31  2:23 ` [Patch 2/2] NetworkPkg: " Fu Siyuan
2016-10-31  7:22   ` Wu, Jiaxin
2016-10-31  7:35     ` Ye, Ting [this message]

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=BC0C045B0E2A584CA4575E779FA2C12A17E92E19@SHSMSX103.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