DPA_LoadStream

Aric Stewart aric at codeweavers.com
Mon Jan 14 10:39:36 CST 2002


Internet Explorer, occasionally tried to load a stream with over 1
million items. This causes an overlap in the size of the array when we
try to allocate (items*2)*8 bytes and then initialize all the times.

To actually allocate the times would require a fair bit of a rewrite of
the DPA code. So this patch catches the maximum number of items that can
be loaded by our existing code and if the number requested exceeds this
return an Out of Memory error.

change log: Catch maximum number of times and return out of memory
error.

-aric



Index: dlls/comctl32/comctl32undoc.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/comctl32undoc.c,v
retrieving revision 1.53
diff -u -u -r1.53 comctl32undoc.c
--- dlls/comctl32/comctl32undoc.c       2001/09/20 18:58:43     1.53
+++ dlls/comctl32/comctl32undoc.c       2002/01/14 14:37:08
@@ -109,6 +109,9 @@
        errCode = E_FAIL;
     }
 
+    if (streamData.dwItems > 536870911)
+        return E_OUTOFMEMORY;
+
     /* create the dpa */
     hDpa = DPA_Create (streamData.dwItems);
     if (!hDpa)




More information about the wine-patches mailing list