]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:talloc: Use memset_s() to avoid the call gets optimized out
authorAndreas Schneider <asn@samba.org>
Tue, 13 Feb 2024 08:22:56 +0000 (09:22 +0100)
committerMartin Schwenke <martins@samba.org>
Sat, 28 Sep 2024 00:11:34 +0000 (00:11 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
lib/talloc/testsuite.c
lib/talloc/wscript

index 6cdd3cddf5c9275af6946e1e16132e7e6d365d81..8b946535ea51de312da6e2af5ceee1b4711ec8a9 100644 (file)
@@ -2097,7 +2097,7 @@ static bool test_magic_protection(void)
                 *
                 * Real attacks would attempt to set a real destructor.
                 */
-               memset(p1, '\0', 32);
+               memset_s(p1, 32, '\0', 32);
 
                /* Then the attack takes effect when the memory's freed. */
                talloc_free(pool);
index 8b5e02d36c5446efeace85b9588e2c8188f41827..1b240ae36536bb586340836c8e8044e4d6d47ef2 100644 (file)
@@ -93,7 +93,7 @@ def build(bld):
                           public_headers=[],
                           enabled=bld.env.TALLOC_COMPAT1)
 
-        testsuite_deps = 'talloc'
+        testsuite_deps = 'talloc replace'
         if bld.CONFIG_SET('HAVE_PTHREAD'):
             testsuite_deps += ' pthread'