Rob Shearman : rpcrt4: Initialise memory passed into RPCs in the server test.

Alexandre Julliard julliard at winehq.org
Thu Dec 20 06:21:40 CST 2007


Module: wine
Branch: master
Commit: c49a73b853a34fc83b1455f1effdc574cf9ae4ed
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c49a73b853a34fc83b1455f1effdc574cf9ae4ed

Author: Rob Shearman <rob at codeweavers.com>
Date:   Wed Dec 19 14:53:30 2007 +0000

rpcrt4: Initialise memory passed into RPCs in the server test.

aligns contains padding, but the memory is marshalled in one block so 
call memset to avoid Valgrind warnings. padded and padded2 are 
marshalled as complex types so this is not required here.

Initialise the dummy member of test_list_t to zero for the TL_NULL case. 
Change the type to the smallest available to not waste buffer space.

---

 dlls/rpcrt4/tests/server.c   |    8 +++++++-
 dlls/rpcrt4/tests/server.idl |    2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index 6b747b8..0869c88 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -549,7 +549,7 @@ basic_tests(void)
   pvectors_t pvecs = {&vec1, &pvec2};
   sp_inner_t spi = {42};
   sp_t sp = {-13, &spi};
-  aligns_t aligns = {3, 4, 5, 6.0};
+  aligns_t aligns;
   pints_t pints;
   ptypes_t ptypes;
   padded_t padded;
@@ -633,6 +633,11 @@ basic_tests(void)
   ok(enum_ord(E3) == 3, "RPC enum_ord\n");
   ok(enum_ord(E4) == 4, "RPC enum_ord\n");
 
+  memset(&aligns, 0, sizeof(aligns));
+  aligns.c = 3;
+  aligns.i = 4;
+  aligns.s = 5;
+  aligns.d = 6.0;
   ok(sum_aligns(&aligns) == 18.0, "RPC sum_aligns\n");
 
   padded.i = -3;
@@ -711,6 +716,7 @@ null_list(void)
 {
   test_list_t *n = HeapAlloc(GetProcessHeap(), 0, sizeof *n);
   n->t = TL_NULL;
+  n->u.x = 0;
   return n;
 }
 
diff --git a/dlls/rpcrt4/tests/server.idl b/dlls/rpcrt4/tests/server.idl
index c9d9143..4ce89d2 100644
--- a/dlls/rpcrt4/tests/server.idl
+++ b/dlls/rpcrt4/tests/server.idl
@@ -112,7 +112,7 @@ cpp_quote("#endif")
     int t;
     [switch_is(t)] union
     {
-      [case(TL_NULL)] int x;  /* end of list */
+      [case(TL_NULL)] char x;  /* end of list */
       [case(TL_LIST)] struct test_list *tail;
     } u;
   } test_list_t;




More information about the wine-cvs mailing list