forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
winansi: check result before using Name for pty #3875
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hmm, seems the second commit will be unneeded after #3864 |
36848d5
to
8a45589
Compare
rebased on top of #3864 so CI can pass for now, please ignore the commits other than the last one |
8a45589
to
039a4cd
Compare
dscho
requested changes
May 30, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working the Wine angle of Git for Windows!
838ccaf
to
085a27c
Compare
dscho
reviewed
May 30, 2022
NtQueryObject under Wine can return a success but fill out no name. In those situations, Wine will set Buffer to NULL, and set result to the sizeof(OBJECT_NAME_INFORMATION). Running a command such as echo "$(git.exe --version 2>/dev/null)" will crash due to a NULL pointer dereference when the code attempts to null terminate the buffer, although, weirdly, removing the subshell or redirecting stdout to a file will not trigger the crash. Code has been added to also check Buffer and Length to ensure the check is as robust as possible due to the current behavior being fragile at best, and could potentially change in the future This code is based on the behavior of NtQueryObject under wine and reactos. Signed-off-by: Christopher Degawa <[email protected]>
085a27c
to
788d6fd
Compare
dscho
approved these changes
May 30, 2022
Let's wait for the build to pass and then merge. |
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 30, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 30, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 30, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 30, 2022
winansi: check result before using Name for pty
dscho
added a commit
to git-for-windows/build-extra
that referenced
this pull request
May 30, 2022
A crash when running Git for Windows in Wine [was fixed](git-for-windows/git#3875). Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 31, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 31, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
May 31, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jun 1, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jun 1, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jun 1, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jun 2, 2022
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 7, 2025
winansi: check result before using Name for pty
Merged
dscho
added a commit
to dscho/git
that referenced
this pull request
Jan 7, 2025
winansi: check result before using Name for pty
dscho
added a commit
to dscho/git
that referenced
this pull request
Jan 7, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 7, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 7, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 8, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 9, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 9, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Jan 17, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Jan 27, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 27, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 28, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Jan 28, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Feb 3, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Feb 5, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Feb 5, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Feb 5, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 5, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Feb 6, 2025
winansi: check result before using Name for pty
dscho
added a commit
that referenced
this pull request
Feb 6, 2025
winansi: check result before using Name for pty
git-for-windows-ci
pushed a commit
that referenced
this pull request
Feb 6, 2025
winansi: check result before using Name for pty
dscho
added a commit
to dscho/git
that referenced
this pull request
Feb 6, 2025
winansi: check result before using Name for pty
dscho
added a commit
to dscho/git
that referenced
this pull request
Feb 6, 2025
winansi: check result before using Name for pty
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NtQueryObject under Wine can return a success but fill out no name.
In those situations, Wine will set Buffer to NULL, and set result to
the sizeof(OBJECT_NAME_INFORMATION).
Running a command such as
echo "$(git.exe --version 2>/dev/null)"
will crash due to a NULL pointer dereference when the code attempts to
null terminate the buffer, although, weirdly, removing the subshell or
redirecting stdout to a file will not trigger the crash.
Alternatives include checking Buffer itself, however, I am not sure
what is the official behavior of the function due to a lack of
documentation.
Another alternative is to check the Length field, but similar to above,
I do not know what the official behavior is.
This code is based on the behavior of NtQueryObject under wine and
reactos.
Signed-off-by: Christopher Degawa [email protected]
opened gitgitgadget#1245 for now