aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeripath2021-07-16 01:17:47 +0100
committerGitHub2021-07-15 20:17:47 -0400
commitbe46f240d9d0d2b283538ca76af2a154cdd770d9 (patch)
tree5ca65c5544ed87fb2adb6470258d2095345b01fa
parentca55e49cc0403a28eaa22d9181a421bb4eaa0048 (diff)
Fix crash following ldap authentication update (#16447) (#16449)
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 <art27@cantab.net>
-rw-r--r--models/login_source.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/login_source.go b/models/login_source.go
index 74341c1e9..23778eedc 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -73,9 +73,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
}