Skip to content

Out of range panic fix#745

Closed
artemseleznev wants to merge 1 commit into
prometheus:masterfrom
Infowatch:master
Closed

Out of range panic fix#745
artemseleznev wants to merge 1 commit into
prometheus:masterfrom
Infowatch:master

Conversation

@artemseleznev

Copy link
Copy Markdown
Contributor

The Svace static analyzer (https://www.ispras.ru/en/technologies/svace/) flagged this code as suspicious: it could lead to a panic (out of range) if len(out) == 0. It might happen if text would be e.g. "bla:bla"

Signed-off-by: Artem Seleznev <seleznyov.artyom@gmail.com>

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's definitely a corrupt input panic here. But do want to continue or error?

@SuperQ

SuperQ commented Oct 21, 2025

Copy link
Copy Markdown
Member

It would also be useful to add some tests.

@discordianfish

Copy link
Copy Markdown
Member

Yeah I feel we should error instead

@SuperQ SuperQ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return an error, not continue.

@SuperQ SuperQ mentioned this pull request Jun 23, 2026
SuperQ added a commit that referenced this pull request Jun 23, 2026
Make sure that we don't panic when parsing invalid crypto files that
have entries that don't start with a `name`.
* Continuation of #745

Signed-off-by: SuperQ <superq@gmail.com>
SuperQ added a commit that referenced this pull request Jun 23, 2026
Make sure that we don't panic when parsing invalid crypto files that
have entries that don't start with a `name`.
* Continuation of #745

Signed-off-by: SuperQ <superq@gmail.com>
SuperQ added a commit that referenced this pull request Jun 27, 2026
Make sure that we don't panic when parsing invalid crypto files that
have entries that don't start with a `name`.
* Continuation of #745

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ

SuperQ commented Jun 27, 2026

Copy link
Copy Markdown
Member

Fixed in #830

@SuperQ SuperQ closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants