Skip to content

Truncation of CPalThread::GetThreadId() return value in InternalCreateThread() #4199

@slowmem

Description

@slowmem

CPalThread::GetThreadId returns a SIZE_T and the value is used to fill the lpThreadId parameter in InternalCreateThread().

On 64-bit platforms, SIZE_T is 64-bit wide. lpThreadId is an LPDWORD and points to a 32-bit wide variable. This causes a value truncation here: https://github.com/dotnet/coreclr/blob/04d31b78087aadc1399cb52df4c0a4795bfdb23f/src/pal/src/thread/thread.cpp#L737

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions