Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants