fix(Parser): prevent index out of bounds error in skipUntilST

This commit is contained in:
CJ van den Berg 2024-07-01 23:39:12 +02:00 committed by Tim Culverhouse
parent b82f4e14b4
commit 72d96638a4

View file

@ -212,6 +212,12 @@ inline fn skipUntilST(input: []const u8) Result {
.event = null,
.n = 0,
};
if (input.len < end + 1 + 1) {
return .{
.event = null,
.n = 0,
};
}
const sequence = input[0 .. end + 1 + 1];
return .{
.event = null,