From 2092ca62859e94facc7ee050cc8b03a7c09dff71 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Fri, 16 Jul 2021 00:14:38 +0100 Subject: [PATCH] Fix crash following ldap authentication update (#16447) Backport #16447 Unfortunately #16268 contained a terrible error, whereby there was a double indirection taken when unmarshalling the source data. This fatally breaks authentication configuration reading. Fix #16342 Signed-off-by: Andrew Thornton --- models/login_source.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/login_source.go b/models/login_source.go index f9bd496b3add4..bbd605bb41d7d 100644 --- a/models/login_source.go +++ b/models/login_source.go @@ -74,9 +74,9 @@ var ( // possible that a Blob may gain an unwanted prefix of 0xff 0xfe. func jsonUnmarshalIgnoreErroneousBOM(bs []byte, v interface{}) error { json := jsoniter.ConfigCompatibleWithStandardLibrary - err := json.Unmarshal(bs, &v) + err := json.Unmarshal(bs, v) if err != nil && len(bs) > 2 && bs[0] == 0xff && bs[1] == 0xfe { - err = json.Unmarshal(bs[2:], &v) + err = json.Unmarshal(bs[2:], v) } return err }