Skip to content

[MAJOR] §8: std::getenv() called with concurrency-mt-unsafe suppression in NATS code #518

@mvillmow

Description

@mvillmow

Finding

Severity: MAJOR
Section: 8
Evidence: src/transport/nats_connection.cpp:23
Principle: SOLID

getenv() is called at connection construction time with a NOLINT suppression for concurrency-mt-unsafe. POSIX specifies getenv() is not thread-safe if another thread modifies the environment concurrently. In a multi-threaded NATS application where connections may be created from worker threads, this is a realistic race condition risk during initialization.


Part of #504

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions