Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid squirrelly memcpy() call in filesystem.cpp #4933

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stl/src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ namespace {
BY_HANDLE_FILE_INFORMATION _Info;
if (GetFileInformationByHandle(_Handle, &_Info)) {
_Id->VolumeSerialNumber = _Info.dwVolumeSerialNumber;
_CSTD memcpy(&_Id->FileId.Identifier[0], &_Info.nFileIndexHigh, 8); // copying from 2 consecutive DWORDs
_CSTD memcpy(&_Id->FileId.Identifier[0], &_Info.nFileIndexHigh, 4);
_CSTD memcpy(&_Id->FileId.Identifier[4], &_Info.nFileIndexLow, 4);
_CSTD memset(&_Id->FileId.Identifier[8], 0, 8);
return __std_win_error::_Success;
}
Expand Down