File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ let v128 s = V128.of_bits (get_string (Types.vec_size Types.V128Type) s)
110
110
let len32 s =
111
111
let pos = pos s in
112
112
let n = vu32 s in
113
- if I32. le_u n (Int32. of_int (len s)) then Int32. to_int n else
113
+ if I32. le_u n (Int32. of_int (len s - pos )) then Int32. to_int n else
114
114
error s pos " length out of bounds"
115
115
116
116
let bool s = (vu1 s = 1 )
Original file line number Diff line number Diff line change 1311
1311
" \60\00\00 " ;; 1st type
1312
1312
;; "\60\00\00" ;; 2nd type (missed)
1313
1313
)
1314
- " unexpected end of section or function "
1314
+ " length out of bounds "
1315
1315
)
1316
1316
1317
1317
;; 1 type declared, 2 given
1600
1600
" \02\00\0b " ;; function body 0
1601
1601
" \02\00\0b " ;; function body 1
1602
1602
)
1603
- " unexpected end of section or function "
1603
+ " length out of bounds "
1604
1604
)
1605
1605
1606
1606
;; 1 export declared, 2 given
1662
1662
" \03\02\01\00 " ;; func section
1663
1663
" \04\04\01 " ;; table section
1664
1664
" \70\00\01 " ;; table 0
1665
- " \09\07 \02 " ;; elem with inconsistent segment count (2 declared, 1 given)
1665
+ " \09\0a \02 " ;; elem with inconsistent segment count (2 declared, 1 given)
1666
1666
" \00\41\00\0b\01\00 " ;; elem 0
1667
1667
" \00\41\00 " ;; elem 1 (partial)
1668
1668
;; "\0b\01\00" ;; elem 1 (missing part)
1774
1774
" \01\04\01 " ;; type section
1775
1775
" \60\00\00 " ;; type 0
1776
1776
" \03\02\01\00 " ;; func section
1777
- " \0a\12 \01 " ;; code section
1777
+ " \0a\13 \01 " ;; code section
1778
1778
" \11\00 " ;; func 0
1779
1779
" \02\40 " ;; block 0
1780
1780
" \41\01 " ;; condition of if 0
Original file line number Diff line number Diff line change 86
86
" \00 asm" " \01\00\00\00 "
87
87
" \00\26\10 " " a custom section" " this is the payload"
88
88
)
89
- " unexpected end "
89
+ " length out of bounds "
90
90
)
91
91
92
92
(assert_malformed
You can’t perform that action at this time.
0 commit comments