From 8dddea2ceda40f2365bd6b1a62826b84dc523b74 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 13 Feb 2024 09:22:56 +0100 Subject: [PATCH] lib:talloc: Use memset_s() to avoid the call gets optimized out Signed-off-by: Andreas Schneider Reviewed-by: Martin Schwenke --- lib/talloc/testsuite.c | 2 +- lib/talloc/wscript | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c index 6cdd3cddf5c..8b946535ea5 100644 --- a/lib/talloc/testsuite.c +++ b/lib/talloc/testsuite.c @@ -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); diff --git a/lib/talloc/wscript b/lib/talloc/wscript index 8b5e02d36c5..1b240ae3653 100644 --- a/lib/talloc/wscript +++ b/lib/talloc/wscript @@ -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' -- 2.47.3