pdb sanity check block_size

* pdb.c (pdb_get_elt_at_index): Only allow block_size to be
	512, 1024, 2048, or 4096.
This commit is contained in:
Alan Modra
2022-09-15 20:45:57 +09:30
parent 8838766ad6
commit 839a4671a9

View File

@ -79,6 +79,13 @@ pdb_get_elt_at_index (bfd *abfd, symindex sym_index)
}
block_size = bfd_getl32 (int_buf);
if ((block_size & -block_size) != block_size
|| block_size < 512
|| block_size > 4096)
{
bfd_set_error (bfd_error_malformed_archive);
return NULL;
}
/* Get block_map_addr. */