diff options
| author | admin <s0las16.224@gmail.com> | 2026-11-22 18:25:41 +0000 |
|---|---|---|
| committer | admin <s0las16.224@gmail.com> | 2026-11-22 18:25:41 +0000 |
| commit | 9ccb1052e4d317b18e82ff4b239bef25bc6b68c7 (patch) | |
| tree | 4276e4a2ef38ca3a1dd53faa0fa8ac4a4400057a /runtime/src/pe_loader.cpp | |
| parent | ec8ec4c9a46c6623f1a9c125afd3566da97f1e0c (diff) | |
Validate named import thunk RVAs before narrowing
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index a59f9d0b1..c10c6ea5a 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -1051,8 +1051,8 @@ void Loader::bind_imports(Module& m) { | |||
| 1051 | uint16_t ord = by_ord ? (uint16_t)IMAGE_ORDINAL64(lookup->u1.Ordinal) : 0; | 1051 | uint16_t ord = by_ord ? (uint16_t)IMAGE_ORDINAL64(lookup->u1.Ordinal) : 0; |
| 1052 | std::string name; | 1052 | std::string name; |
| 1053 | if (!by_ord) { | 1053 | if (!by_ord) { |
| 1054 | require_range(m.name, lookup->u1.AddressOfData, sizeof(uint16_t), m.size, "an import name"); | ||
| 1054 | uint32_t hint = static_cast<uint32_t>(lookup->u1.AddressOfData); | 1055 | uint32_t hint = static_cast<uint32_t>(lookup->u1.AddressOfData); |
| 1055 | require_range(m.name, hint, sizeof(uint16_t), m.size, "an import name"); | ||
| 1056 | name = read_string(m.name, m.base, m.size, hint + sizeof(uint16_t), "an import name"); | 1056 | name = read_string(m.name, m.base, m.size, hint + sizeof(uint16_t), "an import name"); |
| 1057 | } | 1057 | } |
| 1058 | at<IMAGE_THUNK_DATA64>(m.base, static_cast<uint32_t>(iat_rva))->u1.Function = | 1058 | at<IMAGE_THUNK_DATA64>(m.base, static_cast<uint32_t>(iat_rva))->u1.Function = |