wireguard-apple/Sources
John Biggs 12b095470a WireGuardKit: fix incorrect IP address allocation size
According to [1], the `capacity` parameter is specified as "the number
of instances of T in the re-bound region" and not the total size of the
rebound struct.

Without this patch, there are crashes in the extension with the
following error:

  Fatal error: self must be a properly aligned pointer for types Pointee and T`

Since the subsequent line in the code only reads `sizeof(in_addr)` or
`sizeof(in6_addr)` anyway, change the `capacity` parameter to just be a
count of 1.

[1] https://developer.apple.com/documentation/swift/unsafepointer/withmemoryrebound(to:capacity:_:)

Signed-off-by: John Biggs <john.biggs@proton.ch>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2023-02-08 13:08:40 -03:00
..
Shared Model: migrate iOS 14 keychain references to iOS 15 format 2021-09-23 06:11:19 +02:00
WireGuardApp global: apply MIT more consistently 2022-11-17 01:17:52 +01:00
WireGuardKit WireGuardKit: fix incorrect IP address allocation size 2023-02-08 13:08:40 -03:00
WireGuardKitC global: apply MIT more consistently 2022-11-17 01:17:52 +01:00
WireGuardKitGo global: apply MIT more consistently 2022-11-17 01:17:52 +01:00
WireGuardNetworkExtension Global: bump copyright year 2021-06-17 16:56:46 +02:00