From c032dee9452a83985840e501b236bf8d4fea3ca3 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Sat, 14 Nov 2015 21:59:08 -0800 Subject: [PATCH] Adds a paranoia set of the nodes slice to nil. --- consul/prepared_query_endpoint.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/consul/prepared_query_endpoint.go b/consul/prepared_query_endpoint.go index 3cdb9c213..f33146095 100644 --- a/consul/prepared_query_endpoint.go +++ b/consul/prepared_query_endpoint.go @@ -544,6 +544,14 @@ func queryFailover(q queryServer, query *structs.PreparedQuery, // This keeps track of how many iterations we actually run. failovers++ + // Be super paranoid and set the nodes slice to nil since it's + // the same slice we used before. We know there's nothing in + // there, but the underlying msgpack library has a policy of + // updating the slice when it's non-nil, and that feels dirty. + // Let's just set it to nil so there's no way to communicate + // through this slice across successive RPC calls. + reply.Nodes = nil + // Note that we pass along the limit since it can be applied // remotely to save bandwidth. We also pass along the consistency // mode information we were given, so that applies to the remote