Commit 1618253
authored
Avoid out of bounds access in String::fromCharCode (#1254)
If c is negative (this can happen if char is signed), then accessing
sConstStrings[c] is an out of bounds memory access. This results in a
string being created from garbage memory, which can lead to seg faults
later on.
Taking the other branch is safer in this case.1 parent 45246fd commit 1618253
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
1383 | | - | |
| 1383 | + | |
1384 | 1384 | | |
1385 | 1385 | | |
1386 | 1386 | | |
| |||
0 commit comments