Closed qzaidi closed 4 years ago
Hi, I am not using this library directly, but via another package (go-git). I have found that in certain cases, there is panic on this line
https://github.com/sergi/go-diff/blob/da645544ed44df016359bd4c0e3dc60ee3a0da43/diffmatchpatch/diff.go#L452
At the time of panic, the values are
1 iteration ago: i=179592 r=55295 len(chars)=190439 len(lineArray)=58902 next iteration: i=179595 r=65533 len(chars)=190439 len(lineArray)=58902
so clearly lineArray[r] seems to exceed the allocated memory. I still have to understand the code to understand why this happens, but any ideas would be appreciated. Interestingly, in both cases, the diff being processed when panic was unicode.
Duplicate of #89
Please follow the discussion in #89
Hi, I am not using this library directly, but via another package (go-git). I have found that in certain cases, there is panic on this line
https://github.com/sergi/go-diff/blob/da645544ed44df016359bd4c0e3dc60ee3a0da43/diffmatchpatch/diff.go#L452
At the time of panic, the values are
1 iteration ago: i=179592 r=55295 len(chars)=190439 len(lineArray)=58902 next iteration: i=179595 r=65533 len(chars)=190439 len(lineArray)=58902
so clearly lineArray[r] seems to exceed the allocated memory. I still have to understand the code to understand why this happens, but any ideas would be appreciated. Interestingly, in both cases, the diff being processed when panic was unicode.