mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-07 15:15:40 -04:00
Modified read condition in javascript normalizer
Modified conditional statement to test for an out of bounds index before reading from that index.
This commit is contained in:
committed by
Micah Snyder
parent
2e55c901b1
commit
cbbdf8230c
@@ -649,9 +649,9 @@ static void handle_de(yystype *tokens, size_t start, const size_t cnt, const cha
|
||||
for (j = 0; j < parameters_cnt && i < cnt; j++) {
|
||||
parameters[j] = &tokens[i++];
|
||||
if (j != parameters_cnt - 1)
|
||||
while (tokens[i].type != TOK_COMMA && i < cnt) i++;
|
||||
while (i < cnt && tokens[i].type != TOK_COMMA) i++;
|
||||
else
|
||||
while (tokens[i].type != TOK_PAR_CLOSE && i < cnt) i++;
|
||||
while (i < cnt && tokens[i].type != TOK_PAR_CLOSE) i++;
|
||||
i++;
|
||||
}
|
||||
if (j == parameters_cnt)
|
||||
@@ -666,9 +666,9 @@ static void handle_de(yystype *tokens, size_t start, const size_t cnt, const cha
|
||||
for (j = 0; j < parameters_cnt && i < cnt; j++) {
|
||||
parameters[j] = &tokens[i++];
|
||||
if (j != parameters_cnt - 1)
|
||||
while (tokens[i].type != TOK_COMMA && i < cnt) i++;
|
||||
while (i < cnt && tokens[i].type != TOK_COMMA) i++;
|
||||
else
|
||||
while (tokens[i].type != TOK_PAR_CLOSE && i < cnt) i++;
|
||||
while (i < cnt && tokens[i].type != TOK_PAR_CLOSE) i++;
|
||||
i++;
|
||||
}
|
||||
if (j == parameters_cnt)
|
||||
|
||||
Reference in New Issue
Block a user