This commit is contained in:
sevan 2016-08-04 16:36:45 +00:00
parent 14a34a34ce
commit 9d1016b7d6

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" from: @(#)memset.3 8.1 (Berkeley) 6/4/93 .\" from: @(#)memset.3 8.1 (Berkeley) 6/4/93
.\" $NetBSD: memset.3,v 1.12 2013/06/24 07:56:49 wiz Exp $ .\" $NetBSD: memset.3,v 1.13 2016/08/04 16:36:45 sevan Exp $
.\" .\"
.Dd June 23, 2013 .Dd June 23, 2013
.Dt MEMSET 3 .Dt MEMSET 3
@ -64,7 +64,7 @@ returns the original value of
Note that the compiler may optimize away a call to Note that the compiler may optimize away a call to
.Fn memset .Fn memset
if it can prove that the string will not be used by the program again, if it can prove that the string will not be used by the program again,
for example if it is allocated on the stack and about to out of scope. for example if it is allocated on the stack and about to go out of scope.
If you want to guarantee that zeros are written to memory, for example If you want to guarantee that zeros are written to memory, for example
to sanitize a buffer holding a cryptographic secret, use to sanitize a buffer holding a cryptographic secret, use
.Xr explicit_memset 3 . .Xr explicit_memset 3 .