From ee5612363414fe19c932898d2ed9da3778b7a759 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 3 Jul 2016 20:09:14 -0400 Subject: [PATCH] ObjectReflectDiff has an incorrect array index comparison Is comparing the wrong field for bounds. --- pkg/util/diff/diff.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/util/diff/diff.go b/pkg/util/diff/diff.go index a95a1d0055..efa25dd877 100644 --- a/pkg/util/diff/diff.go +++ b/pkg/util/diff/diff.go @@ -177,10 +177,10 @@ func objectReflectDiff(path *field.Path, a, b reflect.Value) []diff { } } var diffs []diff - for i := l; l < lA; i++ { + for i := l; i < lA; i++ { diffs = append(diffs, diff{path: path.Index(i), a: a.Index(i), b: nil}) } - for i := l; l < lB; i++ { + for i := l; i < lB; i++ { diffs = append(diffs, diff{path: path.Index(i), a: nil, b: b.Index(i)}) } return diffs