rpc patch 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Log:
Ove Kaaven <ovek@xxxxxxxxxxxxxxx>
Avoid freeing request packet too early if an exception occurs.

Index: rpc_server.c
===================================================================
RCS file: /home/wine/wine/dlls/rpcrt4/rpc_server.c,v
retrieving revision 1.24
diff -u -r1.24 rpc_server.c
--- rpc_server.c	27 Nov 2003 00:59:36 -0000	1.24
+++ rpc_server.c	8 Jan 2004 14:45:35 -0000
@@ -178,11 +178,18 @@
   return packet;
 }
 
+typedef struct {
+  PRPC_MESSAGE msg;
+  void* buf;
+} packet_state;
+
 static WINE_EXCEPTION_FILTER(rpc_filter)
 {
+  packet_state* state;
   PRPC_MESSAGE msg;
-  msg = TlsGetValue(worker_tls);
-  I_RpcFreeBuffer(msg);
+  state = TlsGetValue(worker_tls);
+  msg = state->msg;
+  if (msg->Buffer != state->buf) I_RpcFreeBuffer(msg);
   msg->RpcFlags |= WINE_RPCFLAG_EXCEPTION;
   msg->BufferLength = sizeof(DWORD);
   I_RpcGetBuffer(msg);
@@ -196,8 +203,11 @@
   RPC_MESSAGE msg;
   RpcServerInterface* sif;
   RPC_DISPATCH_FUNCTION func;
+  packet_state state;
 
-  TlsSetValue(worker_tls, &msg);
+  state.msg = &msg;
+  state.buf = buf;
+  TlsSetValue(worker_tls, &state);
   memset(&msg, 0, sizeof(msg));
   msg.BufferLength = hdr->len;
   msg.Buffer = buf;




[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux