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: fix c++ exception on bad command line arg #46290

Merged
merged 1 commit into from
Jan 22, 2023

Conversation

bnoordhuis
Copy link
Member

Replace stoull() with strtoull(). The former throws an exception when the input is malformed, the latter doesn't.

Fixes: #46223

Replace stoull() with strtoull(). The former throws an exception when
the input is malformed, the latter doesn't.

Fixes: nodejs#46223
@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 Jan 20, 2023
@targos
Copy link
Member

targos commented Jan 20, 2023

Apologies if my remark doesn't make sense, but don't we explicitly disable C++ exceptions in the build?

@bnoordhuis
Copy link
Member Author

Yes, but. -fno-exceptions means our code can't throw. Third-party code like libstdc++ still can (and does.)

@lpinca lpinca added request-ci Add this label to start a Jenkins CI on a PR. commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 21, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 21, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 22, 2023
@nodejs-github-bot nodejs-github-bot merged commit 3700d9e into nodejs:main Jan 22, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 3700d9e

ruyadorno pushed a commit that referenced this pull request Feb 1, 2023
Replace stoull() with strtoull(). The former throws an exception when
the input is malformed, the latter doesn't.

Fixes: #46223
PR-URL: #46290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@ruyadorno ruyadorno mentioned this pull request Feb 1, 2023
juanarbol pushed a commit that referenced this pull request Mar 3, 2023
Replace stoull() with strtoull(). The former throws an exception when
the input is malformed, the latter doesn't.

Fixes: #46223
PR-URL: #46290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@juanarbol juanarbol mentioned this pull request Mar 3, 2023
juanarbol pushed a commit that referenced this pull request Mar 5, 2023
Replace stoull() with strtoull(). The former throws an exception when
the input is malformed, the latter doesn't.

Fixes: #46223
PR-URL: #46290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

worker_threads emergency aborted (std::invalid_argument exception from std::stoull)
8 participants