Skip to content

Panic in PatchMake #31

@shatrugna

Description

@shatrugna

Hitting a slice bounds out of range panic

panic: runtime error: slice bounds out of range

goroutine 47882 [running]:
panic(0xea1500, 0xc820034020)
    /usr/local/go1.6.3.src/src/runtime/panic.go:481 +0x3e6
..gojsondiff/vendor/github.com/sergi/go-diff/diffmatchpatch.(*DiffMatchPatch).patchMake2(0xc8215e5c30, 0xc820f708c0, 0x1e, 0xc821594240, 0xa, 0x18, 0x0, 0x0, 0x0)
    ..gojsondiff/vendor/github.com/sergi/go-diff/diffmatchpatch/dmp.go:1810 +0x647
github.com/apcera/cntm-deps/gojsondiff/vendor/github.com/sergi/go-diff/diffmatchpatch.(*DiffMatchPatch).PatchMake(0xc8215e5c30, 0xc8215e5bb8, 0x2, 0x2, 0x0, 0x0, 0x0)
    ..gojsondiff/vendor/github.com/sergi/go-diff/diffmatchpatch/dmp.go:1768 +0x486
.
.

Able to reproduce this by feeding (left=2016-09-01T03:07:14.807830741Z, right=2016-09-01T03:07:15.154800781Z) to PatchMake.

Following diff being applied to left string:[{0 2016-09-01T03:07:1} {1 5.15} *{0 .154} {-1 .} {0 80} {1 0} {0 78} {-1 3074} {0 1Z}]

while the diff being applied should have been [{0 2016-09-01T03:07:1} {1 5.15} *{0 4} {-1 .} {0 80} {1 0} {0 78} {-1 3074} {0 1Z}]

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions