Reject input sizes that overflow the execute buffer size
allocsize is in_size * sizeof(*in) + FN_NAME_LENGTH with no overflow check, and the buffer is then unconditionally written for FN_NAME_LENGTH bytes. in_size = 0xFFFFFFFFFFFFFFFF makes allocsize wrap to 24, which fails the "> 512" heap test, so the buffer comes from _alloca(24) and RtlZeroMemory(p, 32) runs 8 bytes past it; lstrcpynA can write the full 32. Four wrapping values reach the same place. Guard both pawnio_execute_nt and pawnio_execute_async_nt next to the existing name-length check. Verified against the built DLL with a bogus handle, since the check runs before the handle is touched: all six wrapping sizes now return STATUS_INVALID_PARAMETER, an ordinary size still gets through to STATUS_INVALID_HANDLE, and the same test against the previous build died with 0xC0000409, STATUS_STACK_BUFFER_OVERRUN.
N
namazso committed
bd48f3eff475800b1a2fab4a520e7d5f87e0080d
Parent: 63eb368