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

This commit is contained in:
J. Nick Koston
2025-12-12 11:12:58 -05:00
committed by Jonathan Swoboda
parent 1d13d18a16
commit 78b76045ce
2 changed files with 30 additions and 16 deletions
+1 -1
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");