From 014e20d8a6528670031cc4b0d971337f1f8f8529 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Mon, 22 Jun 2015 01:52:57 +0200 Subject: [PATCH] proc: don't deref nil pointer if getG fails --- proc/threads.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proc/threads.go b/proc/threads.go index daadd069..859d6ddb 100644 --- a/proc/threads.go +++ b/proc/threads.go @@ -308,6 +308,8 @@ func (thread *Thread) getG() (g *G, err error) { return nil, err } g, err = parseG(thread, regs.CX(), false) - g.thread = thread + if err == nil { + g.thread = thread + } return }