Hi Andrew,
ASSERT is here to make sure developer will not change code to return a NULL
pointer. In release it has no impact as HiiGetString can always return proper
string back or the build will fail.
-Shumin
From: Andrew Fish [mailto:af...@apple.com]
Sent: Wednesday, December 03, 2014 11:09 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] [Patch] ShellPkg: Add ASSERT to check pointer to avoid
being dereferenced
On Dec 2, 2014, at 6:56 PM, Qiu, Shumin
<shumin....@intel.com<mailto:shumin....@intel.com>> wrote:
Hi Jaben,
Could you help review the patch? This patch adds ‘ASSERT’ to check the pointer
returned from HiiGetString to avoid pointer dereferenced.
Why are we adding ASSERT to check pointers. It is likely turned off in release
builds. ASSERTs are a debugging aid, not a robustness check.
The shell is an application that runs on a large number of system so it should
handle the errors in C code, and it could also ASSERT() on a debug build.
Thanks,
Andrew Fish
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin....@intel.com<mailto:shumin....@intel.com>>
Thanks
Shumin
<UefiHandleParsingLib.c.patch>------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel