Catch maximum number of times and return out of memory error.
This commit is contained in:
parent
638ae43c89
commit
ca2f40bd9a
|
@ -19,6 +19,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h> /* atoi */
|
#include <stdlib.h> /* atoi */
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "commctrl.h"
|
#include "commctrl.h"
|
||||||
#include "objbase.h"
|
#include "objbase.h"
|
||||||
|
@ -109,6 +110,9 @@ DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM lPar
|
||||||
errCode = E_FAIL;
|
errCode = E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (streamData.dwItems > (UINT_MAX / 2 / sizeof(VOID*))) /* 536870911 */
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
/* create the dpa */
|
/* create the dpa */
|
||||||
hDpa = DPA_Create (streamData.dwItems);
|
hDpa = DPA_Create (streamData.dwItems);
|
||||||
if (!hDpa)
|
if (!hDpa)
|
||||||
|
|
Loading…
Reference in New Issue