2
0
Эх сурвалжийг харах

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

Nikolay Nikolov 1 жил өмнө
parent
commit
79d739baa6
1 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 10 0
      compiler/ogwasm.pas

+ 10 - 0
compiler/ogwasm.pas

@@ -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