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

Handle null pointer in MoveFileExA() and MoveFileWithProgressA() #24

Merged
merged 1 commit into from
Oct 20, 2019

Conversation

isanae
Copy link

@isanae isanae commented Oct 17, 2019

From the documention on MoveFileEx():

If dwFlags specifies MOVEFILE_DELAY_UNTIL_REBOOT and lpNewFileName is NULL, MoveFileEx registers the lpExistingFileName file to be deleted when the system restarts.

Our A versions blindly converted both pointers to wide strings, which crashed when lpNewFileName was null. This adds a check for them.

Whether the W versions behave correctly is unclear to me. They don't seem to check for null at all, but they don't seem to crash either. I'll leave them as-is for now, but this might need a revisit.

Also bumped to 4.4.5.

@isanae isanae changed the title Handle null pointer in MoveFileExA() and MoveFileWithProgressA() (WIP) Handle null pointer in MoveFileExA() and MoveFileWithProgressA() Oct 17, 2019
@LostDragonist LostDragonist merged commit 4c50507 into ModOrganizer2:Develop Oct 20, 2019
@isanae isanae changed the title (WIP) Handle null pointer in MoveFileExA() and MoveFileWithProgressA() Handle null pointer in MoveFileExA() and MoveFileWithProgressA() Oct 20, 2019
@isanae isanae deleted the null-pointer-in-move branch January 14, 2020 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants