Skip to content

Conversation

elieux
Copy link

@elieux elieux commented Oct 6, 2025

No description provided.

`wcsncpy_s()` wants to write the terminating null character so we need
to allocate one more space for it in the target memory block.

This should fix crashes when trying to read passwords.  When this
happened, the password/token wouldn't print out and Git would therefore
ask for a new password every time.

Signed-off-by: David Macek <[email protected]>
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks obviously correct to me, the documentation clearly states that the NUL character must be accounted for. Thank you!

@hickford FYI this seems to have been introduced here, maybe you want to verify that there are no similar problems in near-by patches.

@dscho dscho added this to the Next release milestone Oct 6, 2025
@dscho dscho merged commit 4f6f79f into git-for-windows:main Oct 6, 2025
114 of 115 checks passed
@dscho
Copy link
Member

dscho commented Oct 6, 2025

/add relnote bug A potential memory corruption in the optional wincred credential helper was fixed.

The workflow run was started

github-actions bot pushed a commit to git-for-windows/build-extra that referenced this pull request Oct 6, 2025
A potential memory corruption in the optional `wincred` credential
helper [was fixed](git-for-windows/git#5856).

Signed-off-by: gitforwindowshelper[bot] <[email protected]>
dscho added a commit that referenced this pull request Oct 7, 2025
dscho added a commit that referenced this pull request Oct 7, 2025
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