[PR #40] [MERGED] Fix nil dereference in nodes list command. #1217

Closed
opened 2025-12-29 02:29:15 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/40
Author: @cmars
Created: 6/20/2021
Status: Merged
Merged: 6/20/2021
Merged by: @juanfont

Base: mainHead: upstream-fix-nodes-nil-lastseen


📝 Commits (1)

  • fdcd3bb Fix nil dereference in nodes list command.

📊 Changes

1 file changed (+6 additions, -1 deletions)

View changed files

📝 cmd/headscale/cli/nodes.go (+6 -1)

📄 Description

Fixes a nil pointer dereference observed when listing nodes that have
not yet connected.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb931a4]

goroutine 1 [running]:
github.com/juanfont/headscale/cmd/headscale/cli.glob..func8(0x13c93e0, 0xc0004c4220, 0x0, 0x2)
	/go/src/headscale/cmd/headscale/cli/nodes.go:74 +0x364
github.com/spf13/cobra.(*Command).execute(0x13c93e0, 0xc0004c41e0, 0x2, 0x2, 0x13c93e0, 0xc0004c41e0)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x13ca2e0, 0xc000497110, 0xe76416, 0x6)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
main.main()
	/go/src/headscale/cmd/headscale/headscale.go:89 +0x805
command terminated with exit code 2

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/40 **Author:** [@cmars](https://github.com/cmars) **Created:** 6/20/2021 **Status:** ✅ Merged **Merged:** 6/20/2021 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `upstream-fix-nodes-nil-lastseen` --- ### 📝 Commits (1) - [`fdcd3bb`](https://github.com/juanfont/headscale/commit/fdcd3bb57408736590ffd758727ad2d4d9d13600) Fix nil dereference in nodes list command. ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `cmd/headscale/cli/nodes.go` (+6 -1) </details> ### 📄 Description Fixes a nil pointer dereference observed when listing nodes that have not yet connected. ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb931a4] goroutine 1 [running]: github.com/juanfont/headscale/cmd/headscale/cli.glob..func8(0x13c93e0, 0xc0004c4220, 0x0, 0x2) /go/src/headscale/cmd/headscale/cli/nodes.go:74 +0x364 github.com/spf13/cobra.(*Command).execute(0x13c93e0, 0xc0004c41e0, 0x2, 0x2, 0x13c93e0, 0xc0004c41e0) /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0x13ca2e0, 0xc000497110, 0xe76416, 0x6) /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 main.main() /go/src/headscale/cmd/headscale/headscale.go:89 +0x805 command terminated with exit code 2 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:29:15 +01:00
adam closed this issue 2025-12-29 02:29:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1217