mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
Fixes an issue that could lead to an assert in Debug mode and to undefined behavior in Release mode. Motivation: When reading a new ByteBuffer slice from an originating ByteBuffer slice where the new ByteBuffer slice starts more than 16MiB into the underlying ByteBuffer storage, the new ByteBuffer slice will get a new 0 based storage. When creating the storage for the new slice we have an issue in where storage based indices were used which should have been slice based indices. Modifications: Using the correct indices, when creating a ByteBuffer slice which is more than 16MiB into its originating storage. Result: We can create ByteBuffer slices from slices after the 16MiB threshold. Fixes an issue that was raised in PostgresNIO