This fixes wineserver crashes exposed by recent tests, in the unmerged 
parts of the RPC code.  Parts of this may never see the light of day.  
Relative to H_PL0, of course.

LICENSE: X11

CHANGELOG:

* dlls/rpcrt4: rpc_epmap.c;
  server: rpc_epmap.c:
  Greg Turner <[EMAIL PROTECTED]>
- don't crash the wineserver.
- don't printf("%s", NULL).

-- 
gmt

"The purpose of government is to rein in the rights of the people"
 --President Bill Clinton, MTV interview, 1993
diff -ur -x CVS -x 'bigdif*' ../wine.test/dlls/rpcrt4/rpc_epmap.c ./dlls/rpcrt4/rpc_epmap.c
--- ../wine.test/dlls/rpcrt4/rpc_epmap.c	2002-10-29 13:12:07.000000000 -0600
+++ ./dlls/rpcrt4/rpc_epmap.c	2002-10-29 16:18:23.000000000 -0600
@@ -110,8 +110,8 @@
   TRACE(" ifid=%s\n", debugstr_guid(&If->InterfaceId.SyntaxGUID));
   for (c=0; c<BindingVector->Count; c++) {
     RpcBinding* bind = (RpcBinding*)(BindingVector->BindingH[c]);
-    TRACE(" protseq[%ld]=%s\n", c, bind->Protseq);
-    TRACE(" endpoint[%ld]=%s\n", c, bind->Endpoint);
+    TRACE(" protseq[%ld]=%s\n", c, debugstr_a(bind->Protseq));
+    TRACE(" endpoint[%ld]=%s\n", c, debugstr_a(bind->Endpoint));
   }
   if (UuidVector) {
     for (c=0; c<UuidVector->Count; c++)
diff -ur -x CVS -x 'bigdif*' ../wine.test/server/rpc_epmap.c ./server/rpc_epmap.c
--- ../wine.test/server/rpc_epmap.c	2002-10-29 13:12:07.000000000 -0600
+++ ./server/rpc_epmap.c	2002-10-29 16:39:47.000000000 -0600
@@ -82,7 +82,11 @@
         objcount = 1;
     }
 
-    for (prev=NULL,nprev=NULL,map=epmap,next=map->next; map; prev=nprev,map=next,next=map->next) {
+    prev=NULL;
+    nprev=NULL;
+    map=epmap;
+    while(map) {
+        next = map->next;
         nprev = map;
         if (memcmp(&map->iface, iface, sizeof(RPC_SYNTAX_IDENTIFIER))) continue;
         for (c=0; c<objcount; c++)
@@ -97,6 +101,9 @@
         free(map->protseq);
         free(map->endpoint);
         free(map);
+
+        prev=nprev;
+        map=next;
     }
 }
 

Reply via email to