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

[REVIEW] Do not use strcpy to copy 2 char #848

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

mhoemmen
Copy link
Contributor

Given char src and char dst, one should copy them like dst = src, not like strcpy(&dst, &src).

Using strcpy in this way invokes undefined behavior, and may cause stack corruption.

Fixes #847.

Given `char src` and `char dst`,
one should copy them like `dst = src`,
not like `strcpy(&dst, &src)`.

Fixes rapidsai#847.
@mhoemmen mhoemmen requested a review from a team as a code owner September 27, 2022 16:47
@github-actions github-actions bot added the cpp label Sep 27, 2022
@mhoemmen mhoemmen added non-breaking Non-breaking change bug Something isn't working labels Sep 27, 2022
@cjnolet
Copy link
Member

cjnolet commented Sep 27, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 894a7fe into rapidsai:branch-22.10 Sep 27, 2022
@mhoemmen mhoemmen deleted the Fix-847-strcpy-chars branch September 27, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cpp non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

strcpy of two char
2 participants