public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "gaoliming" <gaoliming@byosoft.com.cn>
To: "'Wenyi Xie'" <xiewenyi2@huawei.com>, <devel@edk2.groups.io>
Cc: <bob.c.feng@intel.com>, <yuwei.chen@intel.com>,
	<songdongkuang@huawei.com>
Subject: 回复: [PATCH EDK2 v1 1/1] BaseTools/VfrCompile: add NULL point check
Date: Mon, 16 Nov 2020 23:51:49 +0800	[thread overview]
Message-ID: <005501d6bc30$657a1500$306e3f00$@byosoft.com.cn> (raw)
In-Reply-To: <1605260747-55149-2-git-send-email-xiewenyi2@huawei.com>

Wenyi:
  Do you meet with the real problem in VfrCompile? Or just find them by code
review. 
  Pccts is from the third party code. If no obvious reason, I don't prefer
to change it. 

Thanks
Liming
> -----邮件原件-----
> 发件人: Wenyi Xie <xiewenyi2@huawei.com>
> 发送时间: 2020年11月13日 17:46
> 收件人: devel@edk2.groups.io
> 抄送: bob.c.feng@intel.com; gaoliming@byosoft.com.cn;
> yuwei.chen@intel.com; songdongkuang@huawei.com;
> xiewenyi2@huawei.com
> 主题: [PATCH EDK2 v1 1/1] BaseTools/VfrCompile: add NULL point check
> 
> add NULL point check after allocating.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> ---
>  BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c
> b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c
> index 051ee4ec5d28..8c861d1542c6 100644
> --- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c
> +++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c
> @@ -1704,6 +1704,7 @@ char *s;
>  	require(ua!=NULL, "cannot allocate UserAction");
> 
>  	ua->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char));
> +	require(ua->action!=NULL, "cannot allocate action");
>  	strcpy(ua->action, s);
>  	return ua;
>  }
> @@ -1742,6 +1743,7 @@ int altnum;
>  	char *p;
>  	sprintf(buf, "_blk%d_alt%d", blockid, altnum);
>  	p = (char *)malloc(strlen(buf)+1);
> +	require(expr,err)(expr,err)(p!=NULL, "cannot allocate buf");
>  	strcpy(p, buf);
>  	return p;
>  }
> --
> 2.20.1.windows.1




  reply	other threads:[~2020-11-16 15:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  9:45 [PATCH EDK2 v1 0/1] BaseTools/VfrCompile: add NULL point check wenyi,xie
2020-11-13  9:45 ` [PATCH EDK2 v1 1/1] " wenyi,xie
2020-11-16 15:51   ` gaoliming [this message]
2020-11-17  1:49     ` 回复: " wenyi,xie

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='005501d6bc30$657a1500$306e3f00$@byosoft.com.cn' \
    --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