dlls/ntdll/tests/env.c -- fixed unitialized buffers, found via valgrind

Zac Brown zac at zacbrown.org
Thu Nov 22 00:59:38 CST 2007


Zac Brown wrote:
> Hi,
>
> Fixes valgrind error:
>     http://kegel.com/wine/valgrind/20071121/vg-ntdll_env.txt
>
> Changelog:
> * Initialize buffers used in test using memset
>
>   

It seems I mangled the patch, here it is again:


---
 dlls/ntdll/tests/env.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/tests/env.c b/dlls/ntdll/tests/env.c
index d822946..c72d5d0 100644
--- a/dlls/ntdll/tests/env.c
+++ b/dlls/ntdll/tests/env.c
@@ -89,6 +89,8 @@ static void testQuery(void)
 
     for (test = tests; test->var; test++)
     {
+    memset(bn, '\0', sizeof(bn));
+    memset(bv, '\0', sizeof(bv));
         name.Length = strlen(test->var) * 2;
         name.MaximumLength = name.Length + 2;
         name.Buffer = bn;
-- 
1.5.2.5


-- 
Zac Brown (817-266-6867)
zac at zacbrown.org
http://zacbrown.org




More information about the wine-patches mailing list