curran / curran/google-diff-match-patch

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

Open
#81 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
Python
Stars
17
Forks
2
PR merge metrics
No merged PRs in 30d

Description

```
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:
- [DiffMatchPatch.m.zip](https://storage.googleapis.com/google-code-attachments/google-diff-match-patch/issue-81/comment-0/DiffMatchPatch.m.zip)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.