4 ms·
>Why would you want to zero a buffer ? Because it may contain sensitive information, I presume. You don't zero sensitive buffers. You randomize them, then fre
by ibisum 12y ago
>Why would you want to zero a buffer ? Because it may contain sensitive information, I presume.
You don't zero sensitive buffers. You randomize them, then free() them.
- clarry 12y agoWhy do you randomize them?
- syncsynchalt 12y agoBecause just free()ing them means anyone calling malloc() can get your password.
- ygra 12y agoA dead store is a dead store. It doesn't matter whether you write something random into it or zero. If the compiler notices that you cannot read it again anyway, it will elide the write.