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

Prepare a PR for https://github.com/arrbee/diff-match-patch-c/issues/5 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

udif
Copy link

@udif udif commented May 15, 2016

OK, Here is a fix for the problem :-)

The problem was caused by the first loop in diff_cleanup_merge().
'i' was used as the position for the current element, and updated to node->next at the end of each loop iteration.
HOWEVER, some of the loop iterations have unallocated the current node pointed by 'i', effectively setting its 'next' element to point to the free store, thereby corrupting 'i'.
The solution was to calculate the next 'i' and saving it at the beginning of the loop iteration.

@lenormf
Copy link

lenormf commented Jun 9, 2018

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.

2 participants