[api] Fix potential buffer overflow in noise PSK base64 decode (#12395)

This commit is contained in:
J. Nick Koston
2025-12-10 04:20:23 +01:00
committed by GitHub
parent b1f9100b02
commit 567e82cfec
2 changed files with 30 additions and 16 deletions

View File

@@ -1669,7 +1669,7 @@ bool APIConnection::send_noise_encryption_set_key_response(const NoiseEncryption
} else {
ESP_LOGW(TAG, "Failed to clear encryption key");
}
} else if (base64_decode(msg.key, psk.data(), msg.key.size()) != psk.size()) {
} else if (base64_decode(msg.key, psk.data(), psk.size()) != psk.size()) {
ESP_LOGW(TAG, "Invalid encryption key length");
} else if (!this->parent_->save_noise_psk(psk, true)) {
ESP_LOGW(TAG, "Failed to save encryption key");