Skip to content

Commit 2be1717

Browse files
authored
JavaScript: Fix CodeQL alert in extractor
This doesn't make a difference in practice because we only run the method on arrays of even length, but we might as well fix it.
1 parent 6dbdc9e commit 2be1717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

javascript/extractor/src/com/semmle/jcorn/Identifiers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private static Pattern nonASCIIidentifier() {
115115
// rare.
116116
private static boolean isInAstralSet(int code, int[] set) {
117117
int pos = 0x10000;
118-
for (int i = 0; i < set.length; i += 2) {
118+
for (int i = 0; i < set.length - 1; i += 2) {
119119
pos += set[i];
120120
if (pos > code) return false;
121121
pos += set[i + 1];

0 commit comments

Comments
 (0)