Skip to content

Commit 88e60c3

Browse files
committed
Add overflow check.
1 parent 9694aee commit 88e60c3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/core/peg.c

+1
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ static const uint8_t *peg_rule(
498498

499499
case RULE_NTH: {
500500
uint32_t nth = rule[1];
501+
if (nth > INT32_MAX) nth = INT32_MAX;
501502
uint32_t tag = rule[3];
502503
int oldmode = s->mode;
503504
CapState cs = cap_save(s);

0 commit comments

Comments
 (0)