[Courgette] Restrict PE rel32 scan size to min(virtual_size, size_of_raw_data).
For PE files, rel32 scanning previously scans .text data spanning
|size_of_raw_data| bytes. However, it's possible for |virtual_size| <
|size_of_raw_data|. In this case, any rel32 references found in the
data beyond |virtual_size| would have an invalid RVA, causing failure
when attempting to translate them to file offsets.
This CL fixes the issue by reducing range of rel32 scan size to
|min(virtual_size, size_of_raw_data)|, thereby avoiding extracting
these invalid rel32 references.
Commit-Queue: Samuel Huang <email@example.com>
Reviewed-by: Etienne Pierre-Doray <firstname.lastname@example.org>
Reviewed-by: Samuel Huang <email@example.com>
2 files changed