Auth: try harder when clearing passwords.

Based on http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html

Thanks again to Matthew Garrett, for pointing this out on twitter.
This commit is contained in:
Tom Hacohen 2015-04-21 10:45:01 +01:00
parent 599eda1a65
commit 99b8d84485
1 changed files with 3 additions and 1 deletions

View File

@ -1434,8 +1434,10 @@ e_util_evas_objects_above_print_smart(Evas_Object *o)
* This is going to work until link time optimizations are good enough.
* Hopefully by then, we'll be able to properly use memset_s().
*/
static void *(* const volatile memset_ptr)(void *, int, size_t) = memset;
EAPI void
e_util_memclear(void *s, size_t n)
{
memset(s, 0, n);
memset_ptr(s, 0, n);
}