Skip to content

Quality: Potential panic on non-UTF8 paths#3052

Open
tomaioo wants to merge 1 commit intoOISF:masterfrom
tomaioo:improve/quality/potential-panic-on-non-utf8-paths
Open

Quality: Potential panic on non-UTF8 paths#3052
tomaioo wants to merge 1 commit intoOISF:masterfrom
tomaioo:improve/quality/potential-panic-on-non-utf8-paths

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 27, 2026

Summary

Quality: Potential panic on non-UTF8 paths

Problem

Severity: Medium | File: eve-validator/src/main.rs:L50

Converting paths with instance.to_str().unwrap() will panic if a path is not valid UTF-8, terminating validation unexpectedly.

Solution

Avoid unwrap() here; use instance.display() for messages and pass instance directly to File::open.

Changes

  • eve-validator/src/main.rs (modified)

Converting paths with `instance.to_str().unwrap()` will panic if a path is not valid UTF-8, terminating validation unexpectedly.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@catenacyber catenacyber added the framework Has a suricata-verify framework change label Apr 30, 2026
@catenacyber
Copy link
Copy Markdown
Collaborator

will panic if a path is not valid UTF-8

I think we want that, enforcing paths are valid utf-8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework Has a suricata-verify framework change

Development

Successfully merging this pull request may close these issues.

2 participants