Fix #4062: Crash when unable to allocate image table

Check if realloc succeeded.
This commit is contained in:
Ted John committed 2016-07-13 19:57:14 +01:00
1 parent 04340021f6
commit b6b8ce18f0
1 file changed
+5
+5
View File
@@ -44,6 +44,11 @@ void ImageTable::Read(IReadObjectContext * context, IStream * stream)
_dataSize = imageDataSize;
_data = Memory::Reallocate(_data, _dataSize);
if (_data == nullptr)
{
context->LogError(OBJECT_ERROR_BAD_IMAGE_TABLE, "Image table too large.");
throw;
}
// Read g1 element headers
uintptr_t imageDataBase = (uintptr_t)_data;