Eric Pouech : wsdapi: Use SecureZeroMemory() to clear magic fields.
Module: wine Branch: master Commit: 8c259abbe56e98855fa2e13fcb295d8f8e6422fd URL: https://gitlab.winehq.org/wine/wine/-/commit/8c259abbe56e98855fa2e13fcb295d8... Author: Eric Pouech <epouech(a)codeweavers.com> Date: Wed Nov 8 09:27:39 2023 +0100 wsdapi: Use SecureZeroMemory() to clear magic fields. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/wsdapi/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wsdapi/memory.c b/dlls/wsdapi/memory.c index ad4d2eefdf9..7003f0aa4cb 100644 --- a/dlls/wsdapi/memory.c +++ b/dlls/wsdapi/memory.c @@ -73,7 +73,8 @@ static void free_allocation(struct memory_allocation *item) } list_remove(&item->entry); - item->magic = 0; + /* Ensure compiler doesn't optimize out the assignment with 0. */ + SecureZeroMemory(&item->magic, sizeof(item->magic)); free(item); }
participants (1)
-
Alexandre Julliard