+ wasm internal object reader: bounds check the tag type index against the types table

This commit is contained in:
Nikolay Nikolov 2024-01-07 01:25:48 +02:00
parent 2de0bcb8d0
commit 79d739baa6

View File

@ -3368,6 +3368,11 @@ implementation
InputError('Error reading import tag type index');
exit;
end;
if TagTypeIdx>high(FFuncTypes) then
begin
InputError('Type index in tag import exceeds bounds of the types table');
exit;
end;
end;
end;
else
@ -3723,6 +3728,11 @@ implementation
InputError('Error reading tag type index');
exit;
end;
if TagTypeIdx>high(FFuncTypes) then
begin
InputError('Type index in tag import exceeds bounds of the types table');
exit;
end;
end;
if AReader.Pos<>(SectionStart+SectionSize) then
begin