Hello Jaben, Shumin or someone else,

 

Please help me understand this one line patch. How can the original code 
dereference a null pointer? For both Mv.c and Cp.c, the
code that calls ShellLevel2StripQuotes() checks the return status before 
attempting to dereference the pointer returned by the
function. If ShellLevel2StripQuotes() returns error, Mv.c and Cp.c both return 
an error to their caller _before_ any attempt to
dereference the returned pointer. The function ShellLevel2StripQuotes() returns 
an error status for all cases where it returns a
null pointer. What am I missing?

 

Also, is ASSERT guaranteed to stop execution for all build types and all values 
of PcdDebugPropertyMask? If so, is stopping
execution a suitable error handling response for release code?

 

Thanks,

Scott

 

From: Carsey, Jaben [mailto:[email protected]] 
Sent: Wednesday, September 24, 2014 12:12 PM
To: Qiu, Shumin
Cc: [email protected]
Subject: Re: [edk2] [Patch] ShellPkg: Refine code style to avoid potential 
NullPointer dereference.

 

Reviewed-by: Jaben Carsey <[email protected] 
<mailto:[email protected]> >

 

From: Qiu, Shumin 
Sent: Monday, September 22, 2014 8:03 PM
To: Carsey, Jaben
Cc: [email protected] <mailto:[email protected]> 
Subject: [edk2] [Patch] ShellPkg: Refine code style to avoid potential 
NullPointer dereference.
Importance: High

 

Hi Jaben,

Could you help review the patch? Pointer 'CleanFilePathStr' returned from 
function 'ShellLevel2StripQuotes' may be NULL and may be
dereferenced.

 

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Qiu Shumin <[email protected] <mailto:[email protected]> >

 

Thanks,

Shumin

 

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to