File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
cpp/ql/src/Security/CWE/CWE-014 Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ contains sensitive data that could somehow be retrieved by an attacker.</p>
1010</overview >
1111<recommendation >
1212
13- <p >Use alternative platform-supplied functions that will not get optimized away. Examples of such
14- functions include <code >memset_s</code >, <code >SecureZeroMemory</code >, and <code >bzero_explicit</code >.
15- Alternatively, passing the <code >-fno-builtin-memset</code > option to the GCC/Clang compiler usually
16- also prevents the optimization. Finally, you can use the public-domain <code >secure_memzero</code > function
17- (see references below). This function, however, is not guaranteed to work on all platforms and compilers.</p >
13+ <p >Use <code >memset_s</code > (from C11) instead of <code >memset</code >, as <code >memset_s</code > will not
14+ get optimized away. Alternatively use platform-supplied functions such as <code >SecureZeroMemory</code > or
15+ <code >bzero_explicit</code > that make the same guarantee. Passing the <code >-fno-builtin-memset</code >
16+ option to the GCC/Clang compiler usually also prevents the optimization. Finally, you can use the
17+ public-domain <code >secure_memzero</code > function (see references below). This function, however, is not
18+ guaranteed to work on all platforms and compilers.</p >
1819
1920</recommendation >
2021<example >
You can’t perform that action at this time.
0 commit comments