Skip to content

Commit 38f7705

Browse files
authored
fix: Fix parseExp reading oob during parseFloat (#1567)
1 parent 1fcc374 commit 38f7705

File tree

4 files changed

+2436
-2392
lines changed

4 files changed

+2436
-2392
lines changed

std/assembly/util/string.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ function parseExp(ptr: usize, len: i32): i32 {
11231123
// check code is 'e' or 'E'
11241124
if ((code | 32) != CharCode.e) return 0;
11251125

1126+
if (!--len) return 0;
11261127
code = <u32>load<u16>(ptr += 2);
11271128
if (code == CharCode.MINUS) {
11281129
if (!--len) return 0;

0 commit comments

Comments
 (0)