Skip to content

fix(libc): reject overlapping secure string ranges - #1647

Closed
MarcZX10 wants to merge 2 commits into
boykopovar:mainfrom
MarcZX10:codex/submit-secure-string-overlap
Closed

MarcZX10 wants to merge 2 commits into
boykopovar:mainfrom
MarcZX10:codex/submit-secure-string-overlap

Conversation

@MarcZX10

@MarcZX10 MarcZX10 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What

Reject overlapping source and destination ranges in strncpy_s, strncat_s, and the existing memcpy_s helper. Check the ranges actually read and written so adjacent, disjoint buffers remain valid.

Tested

Linux x86_64: built guest_string_tests; CTest guest_strings passed (1/1), including overlap and adjacent-range cases. Conventions and git diff --check passed. #1490 covers different string functions.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are listed in TechnicalDebt
  • No notes, investigation files or images added
  • New third-party code is a submodule built from source
  • Generic behaviour, not title specific
  • Depends on: none
  • AI-assisted: yes

@github-actions github-actions Bot added the libc label Oct 8, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

No title is shown hitting overlapping ranges in strncpy_s/strncat_s, and main's current behaviour there is fine until one does. Closing for now; reopen with the title and log line if one does.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants