diff options
author | zeripath <art27@cantab.net> | 2021-07-16 01:17:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 20:17:51 -0400 |
commit | fdb0e82148136f5fe5fdeba666a6f0a30377b1f7 (patch) | |
tree | cb8045374fe7799392a15fb6843a4cfc5f4c8c6c | |
parent | e417cca777ae4ad3bbf96cecce9d0b43f7604d28 (diff) | |
download | gitea-fdb0e82148136f5fe5fdeba666a6f0a30377b1f7.tar.gz gitea-fdb0e82148136f5fe5fdeba666a6f0a30377b1f7.zip |
Fix crash following ldap authentication update (#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>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
-rw-r--r-- | models/login_source.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/login_source.go b/models/login_source.go index f9bd496b3a..bbd605bb41 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 } |