if (ret < 0)
goto error;
+ if ((loaderlen - 56) / 24 < header.imported_library_count)
+ goto error;
+
+ if ((loaderlen - 56 - header.imported_library_count * 24) / 4
+ < header.total_imported_symbol_count)
+ goto error;
+
libraries = bfd_malloc
(header.imported_library_count * sizeof (bfd_pef_imported_library));
imports = bfd_malloc
if (libraries == NULL || imports == NULL)
goto error;
- if (loaderlen < (56 + (header.imported_library_count * 24)))
- goto error;
for (i = 0; i < header.imported_library_count; i++)
{
ret = bfd_pef_parse_imported_library
goto error;
}
- if (loaderlen < (56 + (header.imported_library_count * 24)
- + (header.total_imported_symbol_count * 4)))
- goto error;
for (i = 0; i < header.total_imported_symbol_count; i++)
{
ret = (bfd_pef_parse_imported_symbol