Minor fixes

This commit is contained in:
rudolf-blue 2026-10-08 12:00:20 -04:00
parent 3a294df4da
commit db5d7e027c
3 changed files with 4 additions and 3 deletions

View file

@ -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;
}

View file

@ -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)

View file

@ -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);