prometheus / prometheus/common

toSecret' "return nil, nil" is error-prone

Open
#790 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
295
Forks
367
Avg merge
2d 10h
Merged PRs (30d)
18

Description

here https://github.com/prometheus/common/blob/098669c08af8eee3da33d1d4a4f242a5242cccb8/config/http_config.go#L781-L797

because the error is nil, we may/would be moving nils around, leading to nil pointer dereference

may be the cause of https://github.com/prometheus/prometheus/issues/16622

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in config/http_config.go at lines 781-797 and trace the callers of toSecret to understand how its nil return and nil error are handled. Review the linked Prometheus issue for the reported nil pointer dereference, then confirm the completed change prevents that failure and is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.