Skip to content
New issue

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

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

Already on GitHub? # to your account

nil dereference in webhooks #28088

Closed
KN4CK3R opened this issue Nov 16, 2023 · 0 comments · Fixed by #28089
Closed

nil dereference in webhooks #28088

KN4CK3R opened this issue Nov 16, 2023 · 0 comments · Fixed by #28089
Labels

Comments

@KN4CK3R
Copy link
Member

KN4CK3R commented Nov 16, 2023

          Unfortunately this PR broke Gitea for us as the call to `p.Repository` inside `func (m *MatrixPayload) Package(p *api.PackagePayload) (api.Payloader, error)` (`services/webhook/matrix.go:239`) results in a nil pointer dereference. Looks like `p.Repository` is not set when triggered from `UploadManifest`. Stack trace (Gitea 1.21):
/source/services/webhook/matrix.go:215 (0x23cf774)
/source/services/webhook/payloader.go:58 (0x23dae5d)
/source/services/webhook/matrix.go:239 (0x23cfac4)
/source/services/webhook/webhook.go:198 (0x23dfc6b)
/source/services/webhook/webhook.go:261 (0x23e0435)
/source/services/webhook/notifier.go:882 (0x23da6d0)
/source/services/webhook/notifier.go:863 (0x23da495)
/source/services/notify/notify.go:353 (0x2306326)
/source/routers/api/packages/container/manifest.go:309 (0x23062da)
/source/routers/api/packages/container/manifest.go:184 (0x2305364)
/source/routers/api/packages/container/manifest.go:191 (0x230483c)
/source/routers/api/packages/container/manifest.go:75 (0x2304724)
/source/routers/api/packages/container/container.go:546 (0x2301bec)

Originally posted by @niklaskorz in #27839 (comment)

KN4CK3R added a commit that referenced this issue Nov 17, 2023
Fixes #28088 
Fixes #28094

Added missing tests.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Nov 17, 2023
Fixes go-gitea#28088 
Fixes go-gitea#28094

Added missing tests.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
lunny added a commit that referenced this issue Nov 17, 2023
Backport #28089 by @KN4CK3R

Fixes #28088 
Fixes #28094

Added missing tests.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2024
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
Fixes go-gitea#28088 
Fixes go-gitea#28094

Added missing tests.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
Fixes go-gitea#28088 
Fixes go-gitea#28094

Added missing tests.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
Backport go-gitea#28089 by @KN4CK3R

Fixes go-gitea#28088
Fixes go-gitea#28094

Added missing tests.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 1f82be6)
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant