From db5d7e027ca0dce2252ff62770d314ba1b0772e1 Mon Sep 17 00:00:00 2001 From: rudolf-blue Date: Thu, 8 Oct 2026 12:00:20 -0400 Subject: [PATCH] Minor fixes --- kitty/line-buf.c | 2 +- kitty/remote_control.py | 1 + kitty/vt-parser.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/line-buf.c b/kitty/line-buf.c index eb467adbd..8689043b4 100644 --- a/kitty/line-buf.c +++ b/kitty/line-buf.c @@ -259,7 +259,7 @@ allocate_line_storage(Line *line, bool initialize) { if (initialize) { line->cpu_cells = PyMem_Calloc(line->xnum, sizeof(CPUCell)); line->gpu_cells = PyMem_Calloc(line->xnum, sizeof(GPUCell)); - if (line->cpu_cells == NULL || line->gpu_cells) { + if (line->cpu_cells == NULL || line->gpu_cells == NULL) { PyErr_NoMemory(); return false; } diff --git a/kitty/remote_control.py b/kitty/remote_control.py index 59b5fa8bd..744ce4a42 100644 --- a/kitty/remote_control.py +++ b/kitty/remote_control.py @@ -62,6 +62,7 @@ def parse_cmd(serialized_cmd: memoryview, encryption_key: EllipticCurveKey) -> d pubkey = pcmd.get('pubkey', '') if not pubkey: log_error('Ignoring encrypted rc command without a public key') + return {} d = AES256GCMDecrypt(encryption_key.derive_secret(base64.b85decode(pubkey)), base64.b85decode(pcmd['iv']), base64.b85decode(pcmd['tag'])) data = d.add_data_to_be_decrypted(base64.b85decode(pcmd['encrypted']), True) pcmd = json.loads(data) diff --git a/kitty/vt-parser.c b/kitty/vt-parser.c index 50dc1e6d6..6370ba3f5 100644 --- a/kitty/vt-parser.c +++ b/kitty/vt-parser.c @@ -924,12 +924,12 @@ csi_parse_loop(PS *self, ParsedCSI *csi, const uint8_t *buf, size_t *pos, const return true; case ':': if (!commit_csi_param(self, csi)) return true; - csi->is_sub_param[csi->num_params] = true; + if (csi->num_params < MAX_CSI_PARAMS) csi->is_sub_param[csi->num_params] = true; break; case ';': if (!csi->num_digits) csi->num_digits++; // Empty means zero if (!commit_csi_param(self, csi)) return true; - csi->is_sub_param[csi->num_params] = false; + if (csi->num_params < MAX_CSI_PARAMS) csi->is_sub_param[csi->num_params] = false; break; case DIGIT: csi_add_digit(csi, ch);