New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure repo is loaded in mailer (Completely fix #5891) #5895

Merged
merged 1 commit into from Jan 29, 2019

Conversation

5 participants
@zeripath
Copy link
Contributor

zeripath commented Jan 29, 2019

Although it appears that the master branch is currently protected against the nil dereference bug referred to in #5891 - looking closer at the functions this calls these expect that the repo is loaded in the issue, which may not be available.

This fix ensures that the repo is loaded before calling these methods meaning that any future changes will be protected against a nil dereference. (We should probably also "MustRepo" in those downstream functions - however, injudicious use could cause deadlocks.)

Signed-off-by: Andrew Thornton art27@cantab.net

Also ensure the repo is loaded
Signed-off-by: Andrew Thornton <art27@cantab.net>
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 29, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@002e898). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master   #5895   +/-   ##
========================================
  Coverage          ?     38%           
========================================
  Files             ?     328           
  Lines             ?   48331           
  Branches          ?       0           
========================================
  Hits              ?   18370           
  Misses            ?   27322           
  Partials          ?    2639
Impacted Files Coverage Δ
models/issue_mail.go 11.53% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 002e898...c914f48. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Jan 29, 2019

@zeripath zeripath merged commit 2569363 into go-gitea:master Jan 29, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details

zeripath added a commit that referenced this pull request Jan 29, 2019

Prevent nil dereference in mailIssueCommentToParticipants (#5891, #5895
…) (#5894)

* Ensure issue.Poster is loaded in mailIssueCommentToParticipants (#5891)

Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Also ensure the repo is loaded

Signed-off-by: Andrew Thornton <art27@cantab.net>

@zeripath zeripath deleted the zeripath:completely-fix-dereference-bugs-mailer branch Jan 29, 2019

@zeripath zeripath referenced this pull request Feb 11, 2019

Closed

Gitea fails to start on wrong mailer configuration #5584

2 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment