treewide: replace homegrown memory_erase with explicit_bzero
explicit_bzero was added in glibc 2.25. Make use of it. explicit_bzero is hardcoded to zero the memory, so string erase now truncates the string, instead of overwriting it with 'x'. This causes a visible difference only in the journalctl case.
This commit is contained in:
@@ -189,7 +189,10 @@ static inline void *memmem_safe(const void *haystack, size_t haystacklen, const
|
||||
return memmem(haystack, haystacklen, needle, needlelen);
|
||||
}
|
||||
|
||||
void* memory_erase(void *p, size_t l);
|
||||
#if !HAVE_DECL_EXPLICIT_BZERO
|
||||
void explicit_bzero(void *p, size_t l);
|
||||
#endif
|
||||
|
||||
char *string_erase(char *x);
|
||||
|
||||
char *string_free_erase(char *s);
|
||||
|
||||
Reference in New Issue
Block a user