Commit 852c8585 authored by cznic's avatar cznic

Merge pull request #4 from nikandfor/master

Fix slice out of bounds crash
parents b96e30f1 f20ea980
......@@ -9,3 +9,4 @@
Brian Fallik <bfallik@gmail.com>
Dan Kortschak <dan.kortschak@adelaide.edu.au>
Jan Mercl <0xjnml@gmail.com>
Nikifor Seryakov <nikandfor@gmail.com>
......@@ -450,7 +450,7 @@ func (t *Tree) overflow(p *x, q *d, pi, i int, k interface{} /*K*/, v interface{
t.ver++
l, r := p.siblings(pi)
if l != nil && l.c < 2*kd {
if l != nil && l.c < 2*kd && i != 0 {
l.mvL(q, 1)
t.insert(q, i-1, k, v)
p.x[pi-1].k = q.d[0].k
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment