From 3121f3f8a08ff1fbca9d2d3c7416faf3d7cc1523 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 7 Jan 2024 01:43:47 +0200 Subject: [PATCH] * wasm internal object reader: validate that R_WASM_TAG_INDEX_LEB relocations point to a SYMTAB_EVENT symbol --- compiler/ogwasm.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/ogwasm.pas b/compiler/ogwasm.pas index b1d3230748..e9e69740b6 100644 --- a/compiler/ogwasm.pas +++ b/compiler/ogwasm.pas @@ -2697,6 +2697,11 @@ implementation InputError('Relocation must point to a SYMTAB_GLOBAL symbol'); exit; end; + if (RelocType=R_WASM_TAG_INDEX_LEB) and (SymbolTable[RelocIndex].SymKind<>SYMTAB_EVENT) then + begin + InputError('Relocation must point to a SYMTAB_EVENT symbol'); + exit; + end; if (RelocType in [ R_WASM_FUNCTION_INDEX_LEB, R_WASM_TABLE_INDEX_SLEB,