[PR #1882] [MERGED] Fix crash when a prefix family was empty #2369

Closed
opened 2025-12-29 03:20:57 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1882
Author: @juanfont
Created: 4/17/2024
Status: Merged
Merged: 4/17/2024
Merged by: @juanfont

Base: mainHead: fix-empty-prefix


📝 Commits (1)

  • dd0cc74 Fix crash when a prefix family was empty

📊 Changes

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

View changed files

📝 hscontrol/db/db.go (+10 -6)

📄 Description

This PR fixes a crash reported in Discord https://gist.github.com/christian-heusel/d4eb0fbe529348a86b4cfc76d516ef23.

When a family is not being used (e.g., a user did not have configured IPv6 in their prefixes) the migration would crash, as it was accessing an empty ptr.


🔄 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/1882 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 4/17/2024 **Status:** ✅ Merged **Merged:** 4/17/2024 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `fix-empty-prefix` --- ### 📝 Commits (1) - [`dd0cc74`](https://github.com/juanfont/headscale/commit/dd0cc746881d75da6eebe0615fb1c477d59bd3a2) Fix crash when a prefix family was empty ### 📊 Changes **1 file changed** (+10 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/db/db.go` (+10 -6) </details> ### 📄 Description This PR fixes a crash reported in Discord https://gist.github.com/christian-heusel/d4eb0fbe529348a86b4cfc76d516ef23. When a family is not being used (e.g., a user did not have configured IPv6 in their prefixes) the migration would crash, as it was accessing an empty ptr. --- <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 03:20:57 +01:00
adam closed this issue 2025-12-29 03:20:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2369