Am 25.08.2008 um 21:39 schrieb James Hawkins:

As the code stands now, regardless of your patch, the check for NULL attr on line 154 of dlls/kernel32/file.c will never be hit because we will crash in the TRACE on line 148 of dlls/kernel32/ file.c.

Now I got it. You aren't talking about the TRACE() you cited, but a different one. Thanks for the line numbers, applied to dlls/ntdll/ file.c they make sense.

So, why not fix this? Please push the patch trough Wine's patch accepting mechanism yourself, I'm currently somewhat sick of it.

From e24b273d367aee0f200a0f57ddcceeac2396bf54 Mon Sep 17 00:00:00 2001
From: Markus Hitter <[EMAIL PROTECTED]>
Date: Tue, 26 Aug 2008 00:48:53 +0200
Subject: [PATCH] Fix a possible NULL dereferencing.

Spotted by James Hawkins, the variable at risk is "attr".
---
 dlls/ntdll/file.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 21f028a..d70bce2 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -145,17 +145,19 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE handle, ACCESS_MASK 
access, POBJECT_ATTRIB
     ANSI_STRING unix_name;
     int created = FALSE;
 
-    TRACE("handle=%p access=%08x name=%s objattr=%08x root=%p sec=%p io=%p 
alloc_size=%p\n"
-          "attr=%08x sharing=%08x disp=%d options=%08x ea=%p.0x%08x\n",
-          handle, access, debugstr_us(attr->ObjectName), attr->Attributes,
-          attr->RootDirectory, attr->SecurityDescriptor, io, alloc_size,
-          attributes, sharing, disposition, options, ea_buffer, ea_length );
+    TRACE( "handle=%p access=%08x io=%p alloc_size=%p attr=%08x\n"
+           "sharing=%08x disp=%d options=%08x ea=%p.0x%08x\n",
+           handle, access, io, alloc_size, attributes, sharing, disposition,
+           options, ea_buffer, ea_length );
 
     if (!attr || !attr->ObjectName)
     {
         TRACE("returning STATUS_INVALID_PARAMETER\n");
         return STATUS_INVALID_PARAMETER;
     }
+    
+    TRACE( "name=%s objattr=%08x root=%p sec=%p\n", 
debugstr_us(attr->ObjectName),
+           attr->Attributes, attr->RootDirectory, attr->SecurityDescriptor );
 
     if (alloc_size) FIXME( "alloc_size not supported\n" );
 
-- 
1.5.6.3




My comment still stands that the added TRACE is absolutely superfluous.

Makes 2 pro, 1 neutral. Do whatever you want with it.


MarKus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/






Reply via email to