Don't loop infinitely when the RVA lies outside of the file.

This commit is contained in:
jfrijters 2010-04-18 08:59:18 +00:00
Родитель 0f2ade7ce0
Коммит 5de77bb9f7
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -93,6 +93,11 @@ namespace IKVM.Reflection.Reader
while (size > 0)
{
int read = module.stream.Read(data, offset, size);
if (read == 0)
{
// C++ assemblies can have fields that have an RVA that lies outside of the file
break;
}
offset += read;
size -= read;
}