Sometimes passwords/hash/keys & other private information is stored in variables and hence in memory/RAM during code execution.
while some situations (i.e. Linux Kernels see here Is there any Linux distro or kernel patch that wipes a process memory space after the process exits? ) care about wiping used memory I was wondering more about the broader picture:
Question is therefore: Should the programmer of code care about wiping (i.e. zerosetting) sensitive information by her/himself? More precise should I do something like this
int main() { char bufferWithSecret [10]; sprintf (bufferWithSecret, "%d",generateKey()); // do some stuff // ... // ... sprintf (bufferWithSecret, "000000000"); // wipe the memory }