mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
termio/exec: limit max apc string length
This commit is contained in:
@ -1107,6 +1107,14 @@ const StreamHandler = struct {
|
||||
}
|
||||
|
||||
try self.apc_data.append(self.alloc, byte);
|
||||
|
||||
// Prevent DoS attack.
|
||||
const limit = 100 * 1024 * 1024; // 100MB
|
||||
if (self.apc_data.items.len > limit) {
|
||||
log.warn("APC command too large, ignoring", .{});
|
||||
self.apc_state = .ignore;
|
||||
self.apc_data.clearAndFree(self.alloc);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn apcEnd(self: *StreamHandler) !void {
|
||||
|
Reference in New Issue
Block a user