libopenkey
libopenkey copied to clipboard
Memsets might be optimized away
In https://github.com/henryk/libopenkey/blob/master/libopenkey/libopenkey.c, line 1715:
if(buf != NULL) {
memset(buf, 0, buf_length);
free(buf);
}
The memset() might be optimized away by the compiler, see eg https://media.ccc.de/v/35c3-9788-memsad Similar in line 1808 and 482. I guess the one in line 2092, 2129 might also be optimized away. If there is a gcry_free() instead of free() the compiler doesnt optimize this away in my tests.