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

src: do not get string_view from temp string #53688

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

zcbenz
Copy link
Contributor

@zcbenz zcbenz commented Jul 2, 2024

The result of std::string().substr() will be destroyed at the end of expression and creating std::string_view from it results in dangling pointer.

The result of std::string().substr() will be destroyed at the end of
expression and creating std::string_view from it results in dangling
pointer.
@zcbenz zcbenz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 2, 2024
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jul 2, 2024
@anonrig anonrig added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 2, 2024
Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why Rust exists 😄

@zcbenz zcbenz added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jul 3, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2024
@nodejs-github-bot
Copy link
Collaborator

@zcbenz zcbenz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 4, 2024
@nodejs-github-bot
Copy link
Collaborator

@zcbenz zcbenz added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 5, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 5, 2024
@nodejs-github-bot nodejs-github-bot merged commit 2fd798d into nodejs:main Jul 5, 2024
73 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 2fd798d

aduh95 pushed a commit that referenced this pull request Jul 12, 2024
The result of std::string().substr() will be destroyed at the end of
expression and creating std::string_view from it results in dangling
pointer.

PR-URL: #53688
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@aduh95 aduh95 mentioned this pull request Jul 12, 2024
aduh95 pushed a commit that referenced this pull request Jul 16, 2024
The result of std::string().substr() will be destroyed at the end of
expression and creating std::string_view from it results in dangling
pointer.

PR-URL: #53688
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants