[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Fixex from IBM HPB
From:       David.Goodenough () dga ! co ! uk
Date:       2000-10-30 13:59:41
[Download RAW message or body]

OK, lets start with a nice simple one.  This is for objects/enhmetafile.c,
and is a safety check to ensure that MapViewOfFile did not return NULL.  I
have no idea of the circumstances that can cause this condition, or how to
reproduce it.

(See attached file: enhmetafile.patch)

["enhmetafile.patch" (application/octet-stream)]

Add check to see we got a Mapped view of the file before using pointer

diff -urN objects/enhmetafile.c
--- objects/enhmetafile.c
+++ objects/enhmetafile.c
@@ -98,6 +98,7 @@
     hMapping = CreateFileMappingA( hFile, NULL, PAGE_READONLY, 0, 0, NULL );
     emh = MapViewOfFile( hMapping, FILE_MAP_READ, 0, 0, 0 );
 
+    if (!emh) return 0;
     if (emh->iType != EMR_HEADER || emh->dSignature != ENHMETA_SIGNATURE) {
         WARN("Invalid emf header type 0x%08lx sig 0x%08lx.\n",
 	     emh->iType, emh->dSignature);



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic