From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.36660.1605541918306774515 for ; Mon, 16 Nov 2020 07:52:02 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([101.224.113.110]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 16 Nov 2020 23:51:49 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Wenyi Xie'" , Cc: , , References: <1605260747-55149-1-git-send-email-xiewenyi2@huawei.com> <1605260747-55149-2-git-send-email-xiewenyi2@huawei.com> In-Reply-To: <1605260747-55149-2-git-send-email-xiewenyi2@huawei.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggRURLMiB2MSAxLzFdIEJhc2VUb29scy9WZnJDb21waWxlOiBhZGQgTlVMTCBwb2ludCBjaGVjaw==?= Date: Mon, 16 Nov 2020 23:51:49 +0800 Message-ID: <005501d6bc30$657a1500$306e3f00$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIyX8x12jvgTSXqZ6OYR4wUpn702wLSidiyqP0MBSA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Wenyi: Do you meet with the real problem in VfrCompile? Or just find them by = code review.=20 Pccts is from the third party code. If no obvious reason, I don't = prefer to change it.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Wenyi Xie > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA11=D4=C213=C8=D5 17:46 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: bob.c.feng@intel.com; gaoliming@byosoft.com.cn; > yuwei.chen@intel.com; songdongkuang@huawei.com; > xiewenyi2@huawei.com > =D6=F7=CC=E2: [PATCH EDK2 v1 1/1] BaseTools/VfrCompile: add NULL point = check >=20 > add NULL point check after allocating. >=20 > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Signed-off-by: Wenyi Xie > --- > BaseTools/Source/C/VfrCompile/Pccts/antlr/main.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > 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!=3DNULL, "cannot allocate UserAction"); >=20 > ua->action =3D (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); > + require(ua->action!=3DNULL, "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 =3D (char *)malloc(strlen(buf)+1); > + require(expr,err)(expr,err)(p!=3DNULL, "cannot allocate buf"); > strcpy(p, buf); > return p; > } > -- > 2.20.1.windows.1