Mapping a zero size file should fail.
authorMike McCormack <mike@codeweavers.com>
Fri, 9 Jan 2004 00:34:14 +0000 (00:34 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 9 Jan 2004 00:34:14 +0000 (00:34 +0000)
server/mapping.c

index 092f48a863eff5d3ad83062cc8cbc4287a0bc841..f84f51c4ab40628aa86bc20e2f0c23e97716809b 100644 (file)
@@ -289,6 +289,11 @@ static struct object *create_mapping( int size_high, int size_low, int protect,
         if (!size_high && !size_low)
         {
             if (!get_file_size( mapping->file, &size_high, &size_low )) goto error;
+            if (!size_high && !size_low)
+            {
+                set_error( STATUS_FILE_INVALID );
+                goto error;
+            }
         }
         else
         {