Skip to content

Commit

Permalink
Fix crash following ldap authentication update (go-gitea#16447)
Browse files Browse the repository at this point in the history
Unfortunately go-gitea#16268 contained a terrible error, whereby there was a double
indirection taken when unmarshalling the source data. This fatally breaks
authentication configuration reading.

Fix go-gitea#16342

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
  • Loading branch information
2 people authored and AbdulrhmnGhanem committed Aug 10, 2021
1 parent a62da02 commit 9f9c330
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/login_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9f9c330

Please sign in to comment.