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

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

Maintainers usually reply within 2 days

A pull request for this has already been merged.

  • #897 by @alliasgher — merged

Assessment

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

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.

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

Dominant language
Go
Stars
297
Forks
380
Avg merge
3d 18h
Merged PRs (30d)
12

Getting set up

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.

More from prometheus/common

All issues in prometheus/common

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.