mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
+ wasm internal object reader: validate that relocations that should point to a SYMTAB_FUNCTION entry, actually point to such entry
This commit is contained in:
parent
baf9681684
commit
3071ae231a
@ -2678,6 +2678,15 @@ implementation
|
||||
InputError('R_WASM_SECTION_OFFSET_I32 must point to a SYMTAB_SECTION symbol');
|
||||
exit;
|
||||
end;
|
||||
if (RelocType in [
|
||||
R_WASM_FUNCTION_INDEX_LEB,
|
||||
R_WASM_TABLE_INDEX_SLEB,
|
||||
R_WASM_TABLE_INDEX_I32,
|
||||
R_WASM_FUNCTION_OFFSET_I32]) and (SymbolTable[RelocIndex].SymKind<>SYMTAB_FUNCTION) then
|
||||
begin
|
||||
InputError('Relocation must point to a SYMTAB_FUNCTION symbol');
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
if AReader.Pos<>(SectionStart+SectionSize) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user