mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
terminal: fix uninitialized memory access when kitty color protocol
This commit is contained in:
@ -493,6 +493,7 @@ pub const Parser = struct {
|
||||
},
|
||||
};
|
||||
|
||||
self.temp_state = .{ .key = "" };
|
||||
self.state = .kitty_color_protocol_key;
|
||||
self.complete = true;
|
||||
self.buf_start = self.buf_idx;
|
||||
@ -1730,3 +1731,17 @@ test "OSC: kitty color protocol double reset" {
|
||||
p.reset();
|
||||
p.reset();
|
||||
}
|
||||
|
||||
test "OSC: kitty color protocol no key" {
|
||||
const testing = std.testing;
|
||||
|
||||
var p: Parser = .{ .alloc = testing.allocator };
|
||||
defer p.deinit();
|
||||
|
||||
const input = "21;";
|
||||
for (input) |ch| p.next(ch);
|
||||
|
||||
const cmd = p.end('\x1b').?;
|
||||
try testing.expect(cmd == .kitty_color_protocol);
|
||||
try testing.expectEqual(0, cmd.kitty_color_protocol.list.items.len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user