Dana-Ferguson / google-diff-match-patch

Automatically exported from code.google.com/p/google-diff-match-patch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash observed when very long paragraphs are diffed (Objective-C)

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Create two similar string with a paragraph of over 10,000 characters (no \n 
characters for a long time)
2. Diff the two strings.  

I get a crash in DiffMatchPatch on line 674, an array is not being allocated, 
crashing in the for loop.

What version of the product are you using? On what operating system?
I am using OS X 10.8 Mountain Lion with XCode 4.5.2

Please provide any additional information below.

I was able to 'fix' the issue by changing the allocation of these arrays to 
malloc, the .m file is attached.  However, there might be more issues caused by 
this issue with very long lines.

If you have any trouble repeating the issue, I'd be happy to help.

Original issue reported on code.google.com by stephen....@gmail.com on 30 Jan 2013 at 4:59

Attachments: