Skip to content

Conversation

kraai
Copy link

@kraai kraai commented Jan 4, 2019

If reset_tree returns a non-zero value, stash_working_tree calls
object_array_clear with &rev.pending before rev is initialized. This
causes a segmentation fault. Prevent this by initializing rev before
calling reset_tree.

This fixes #2006.

Signed-off-by: Matthew Kraai mkraai@its.jnj.com

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.

Excellent find! Just a minor request to change the test, and we're good to go!

t/t3903-stash.sh Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be moved up 1 line and should read test_when_finished "git rm -f file4" instead.

If reset_tree returns a non-zero value, stash_working_tree calls
object_array_clear with &rev.pending before rev is initialized.  This
causes a segmentation fault.  Prevent this by initializing rev before
calling reset_tree.

This fixes git-for-windows#2006.

Signed-off-by: Matthew Kraai <mkraai@its.jnj.com>
@dscho dscho merged commit 6b28658 into git-for-windows:master Jan 9, 2019
@dscho dscho added this to the v2.20.1(2) milestone Jan 9, 2019
@dscho
Copy link
Member

dscho commented Jan 9, 2019

Thanks!

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.

Segmentation fault running git stash with git add -N file
2 participants