Replace unsafe `std::strcat` with safer string operations in `print.cpp` · Issue #7046 · TheHPXProject/hpx · GitHub
Skip to content

Replace unsafe std::strcat with safer string operations in print.cpp #7046

Closed

Description

@LSUDOKO

Description

The file
print.cpp
at line 289 uses the unsafe C-style string function std::strcat, which is prone to buffer overflow vulnerabilities. This function does not perform bounds checking and can write beyond the allocated buffer if the source string is too long.

std::strcat(hostname_, temp.c_str());  // unsafe

Why This Matters

  • Fixed buffer: char hostname_[32]
  • No bounds checking → risk of overflow
  • GCC warning (-Wrestrict) is suppressed instead of fixed

Activity

  1. added a commit that references this issue on Mar 17, 2026
  2. added this to the 2.0.0 milestone on Mar 18, 2026
  3. added a commit that references this issue on Mar 20, 2026
  4. hkaiser commented on Mar 23, 2026

    @hkaiser
    Contributor

    This was fixed by merging #7048

  5. added a commit that references this issue on Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions