fragkopoulos / google-diff-match-patch

Automatically exported from code.google.com/p/google-diff-match-patch
Apache License 2.0
0 stars 0 forks source link

Uninitialised variable in C++ method diff_xIndex #66

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I ran my application through valgrind and it exposed a case where 
lastDiff.operation was used without being initialised within diff_xIndex. It 
may never be assigned to in the loop and so the test against DELETE is against 
an uninitialised value since the Diff default constructor does not set a value.

Either the default constructor should set a value or the code should be altered 
to mimic the Java version with lastDiff being a pointer to a Diff.

Original issue reported on code.google.com by fotherin...@gmail.com on 18 Feb 2012 at 9:47