From b548b5aeb00dd51f4f2d982f60d9dec5af8615e8 Mon Sep 17 00:00:00 2001
From: Felix Lange <fjl@users.noreply.github.com>
Date: Wed, 15 May 2019 11:11:17 -0400
Subject: [PATCH] p2p/discover: fix crash in Resolve (#19579)

---
 p2p/discover/v4_udp.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/p2p/discover/v4_udp.go b/p2p/discover/v4_udp.go
index b0b0053a7..b3569b671 100644
--- a/p2p/discover/v4_udp.go
+++ b/p2p/discover/v4_udp.go
@@ -426,11 +426,11 @@ func (t *UDPv4) Resolve(n *enode.Node) *enode.Node {
 		}
 	}
 	// Otherwise perform a network lookup.
-	var key *enode.Secp256k1
-	if n.Load(key) != nil {
+	var key enode.Secp256k1
+	if n.Load(&key) != nil {
 		return n // no secp256k1 key
 	}
-	result := t.LookupPubkey((*ecdsa.PublicKey)(key))
+	result := t.LookupPubkey((*ecdsa.PublicKey)(&key))
 	for _, rn := range result {
 		if rn.ID() == n.ID() {
 			if rn, err := t.requestENR(rn); err == nil {
-- 
GitLab