Attached is a patch that corrects martin wilck's previous patch. It just adds 
an if flags before deref'ing the flags variable. Not sure if this is the most 
correct, but it corrects the crash. 

Files affected: wine/files/file.c

Patch against cvs from 04232002 with martin wilck's 4th in his last series of 
patch applied. Fixes a crash for aol7 and internet explorer (the only two 
apps I tested, probably for lots of other apps also)

On Wednesday 24 April 2002 02:20 pm, Michael Cardenas wrote:
> Hello Martin.
>
> I tested your new series of patches with aol7 and I get a crash. Attached
--- file.c.cvs	Wed Apr 24 14:48:15 2002
+++ file.c	Wed Apr 24 14:42:14 2002
@@ -344,8 +344,12 @@
     ret = wine_server_handle_to_fd( handle, access, &fd, type, flags );
     if (ret) SetLastError( RtlNtStatusToDosError(ret) );
 
-    if (  ( (access & GENERIC_READ)  && (*flags & FD_FLAG_RECV_SHUTDOWN ) ) ||
-          ( (access & GENERIC_WRITE) && (*flags & FD_FLAG_SEND_SHUTDOWN ) ) )
+    if ( flags && 
+         (
+	  ( (access & GENERIC_READ)  && (*flags & FD_FLAG_RECV_SHUTDOWN ) ) ||
+          ( (access & GENERIC_WRITE) && (*flags & FD_FLAG_SEND_SHUTDOWN ) )
+         )
+       )
     {
         close (fd);
         SetLastError ( ERROR_PIPE_NOT_CONNECTED );

Reply via email to