Skip to content

NIOFileSytem: crash when passing maximumSizeAllowed: .gibibytes(.max) to disable limits #2877

@weissi

Description

@weissi
request.body = try await Data(buffer: ByteBuffer(
    contentsOf: filePath,
    maximumSizeAllowed: .gibibytes(.max)
))

crashes with

Thread 5 Crashed:: NIO-SGLTN-0-#4
0   0x104f0e510 Swift runtime failure: arithmetic overflow + 0 [inlined]
1   0x104f0e510 static ByteCount.gibibytes(_:) + 76 (ByteCount.swift:79)

but it shouldn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions