[cfe-dev] Security fail (memset being optimized away)

myLC@gmx.de via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 4 06:31:38 PST 2019


On 1/4/19 1:47 PM, Jonny Grant wrote:
> Why not just write an inline function which does after memset :-
> 
> if(*buf!=0) *buf=0;


This would only zero one byte, but it would get optimized away
as the buffer goes out of scope (= is being discarded).



More information about the cfe-dev mailing list