From cd6099113fa037ed43a71ce764506f608d6007c5 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 24 Nov 2020 11:07:49 -0800 Subject: [PATCH] ipn: add a comment about skipping files with null bytes Updates #954 --- ipn/prefs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipn/prefs.go b/ipn/prefs.go index 539d8df5b..c65ca6095 100644 --- a/ipn/prefs.go +++ b/ipn/prefs.go @@ -278,6 +278,11 @@ func LoadPrefs(filename string) (*Prefs, error) { return nil, fmt.Errorf("LoadPrefs open: %w", err) // err includes path } if bytes.Contains(data, jsonEscapedZero) { + // Tailscale 1.2.0 - 1.2.8 on Windows had a memory corruption bug + // in the backend process that ended up sending NULL bytes over JSON + // to the frontend which wrote them out to JSON files on disk. + // So if we see one, treat is as corrupt and the user will need + // to log in again. (better than crashing) return nil, os.ErrNotExist } p, err := PrefsFromBytes(data, false)