db: fix slice aliasing in migration tag merge

The migration at db.go:680 appends validated tags to existing tags
using append(existingTags, validatedTags...) where existingTags
aliases node.Tags. When node.Tags has spare capacity, append writes
into the shared backing array, and the subsequent slices.Sort
corrupts the original.

Clone existingTags before appending to prevent aliasing.
This commit is contained in:
Kristoffer Dalby
2026-04-08 12:25:21 +00:00
committed by Kristoffer Dalby
parent 82bb4331f5
commit 3037e5eee0

View File

@@ -677,7 +677,7 @@ AND auth_key_id NOT IN (
continue
}
mergedTags := append(existingTags, validatedTags...)
mergedTags := append(slices.Clone(existingTags), validatedTags...)
slices.Sort(mergedTags)
mergedTags = slices.Compact(mergedTags)