]> source.dussan.org Git - gitea.git/commit
SessionUser protection against nil pointer dereference (#21581)
authorPaweł Bogusławski <pawel.boguslawski@ib.pl>
Mon, 24 Oct 2022 19:05:35 +0000 (21:05 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Oct 2022 19:05:35 +0000 (20:05 +0100)
commitd5856fece7d9cc70d5888bbee9fd0eeddf91c8da
tree38f3a6c7361fea137332fe5f050a39fabebe8add
parent0571ddc368efda40479a3b817fba5e3cb704e47b
SessionUser protection against nil pointer dereference (#21581)

Backport #21358

`SessionUser` should be protected against passing `sess` = `nil` to
avoid

```
PANIC: runtime error: invalid memory address or nil pointer dereference
```

in

https://github.com/go-gitea/gitea/pull/18452/files#diff-a215b82aadeb8b4c4632fcf31215dd421f804eb1c0137ec6721b980136e4442aR69

after upgrade from gitea v1.16 to v1.17.

Related: https://github.com/go-gitea/gitea/pull/18452
services/auth/session.go