Skip to content

xrTrims.cpp: Fix _CopyVal to actually be safe#6

Merged
themrdemonized merged 1 commit intothemrdemonized:all-in-one-vs2022from
clayne:1691818550-xr-trims-safety
Aug 12, 2023
Merged

xrTrims.cpp: Fix _CopyVal to actually be safe#6
themrdemonized merged 1 commit intothemrdemonized:all-in-one-vs2022from
clayne:1691818550-xr-trims-safety

Conversation

@clayne
Copy link
Contributor

@clayne clayne commented Aug 12, 2023

  • _CopyVal: Called by _GetItem (which explicitly takes a dst_size argument), this function will stomp dst if the tokenized string is longer than the size of dst. Fix this by actually using a dst_size argument (which the caller already has) and clamping the strncpy to it.

* _CopyVal: Called by _GetItem (which explicitly takes a dst_size
  argument), this function will stomp dst if the tokenized string
  is longer than the size of dst. Fix this by actually using a
  dst_size argument (which the caller already has) and clamping the
  strncpy to it.
@clayne clayne changed the base branch from vs2022 to all-in-one-vs2022 August 12, 2023 06:10
@themrdemonized themrdemonized merged commit c5a4d49 into themrdemonized:all-in-one-vs2022 Aug 12, 2023
themrdemonized added a commit that referenced this pull request Aug 12, 2023
xrTrims.cpp: Fix _CopyVal to actually be safe

(cherry picked from commit c5a4d49)
(cherry picked from commit f9402af)
themrdemonized added a commit that referenced this pull request Aug 12, 2023
xrTrims.cpp: Fix _CopyVal to actually be safe

(cherry picked from commit c5a4d49)
@clayne clayne deleted the 1691818550-xr-trims-safety branch August 19, 2023 15:43
ARandomUserN pushed a commit to ARandomUserN/xray-monolith that referenced this pull request Nov 21, 2025
ARandomUserN pushed a commit to ARandomUserN/xray-monolith that referenced this pull request Nov 21, 2025
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.

2 participants