Fix potential OOB during negotiation

Reported by @Grivus with SoftEther.

Closes #143
This commit is contained in:
Davide De Rosa 2019-12-22 16:27:43 +01:00
parent 116883c218
commit e3241f4f4d
2 changed files with 8 additions and 4 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Index out of range during negotiation (Grivus). [#143](https://github.com/passepartoutvpn/tunnelkit/pull/143)
## 2.2.1 (2019-12-14)
### Fixed

View File

@ -199,10 +199,8 @@ extension OpenVPN {
}
// drop queued out packets if ack-ed
for (i, packet) in queue.outbound.enumerated() {
if packetIds.contains(packet.packetId) {
queue.outbound.remove(at: i)
}
queue.outbound.removeAll {
return packetIds.contains($0.packetId)
}
// remove ack-ed packets from pending