[PATCH] libuuid: use explicit_bzero() in uuid_clear() when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This ensures value is blanked.  It is possible compiler optimization removed
earlier uuid_clear() calls as unnecessary if value was not used after clear.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 libuuid/src/clear.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libuuid/src/clear.c b/libuuid/src/clear.c
index 2d91fee93..5b1392464 100644
--- a/libuuid/src/clear.c
+++ b/libuuid/src/clear.c
@@ -38,6 +38,10 @@
 
 void uuid_clear(uuid_t uu)
 {
+#ifdef HAVE_EXPLICIT_BZERO
+	explicit_bzero(uu, 16);
+#else
 	memset(uu, 0, 16);
+#endif
 }
 
-- 
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux