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

Replace stoul with ToIntegral in dbwrapper #23214

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Oct 7, 2021

The string is created with %llu. See:

snprintf(buf, sizeof(buf), "%llu",
static_cast<unsigned long long>(total_usage));

So it seems odd to silently accept when parsing: whitespace, a sign character, trailing chars, overflow, ....

Fix that by using the stricter ToIntegral.

@practicalswift
Copy link
Contributor

Concept ACK

Very happy to see the KNOWN_VIOLATIONS list in test/lint/lint-locale-dependence.sh shrink. Only a few violations left to tackle! :)

@laanwj
Copy link
Member

laanwj commented Oct 7, 2021

Code review ACK fa165e9

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Code-review ACK fa165e9

@practicalswift
Copy link
Contributor

cr ACK fa165e9

@fanquake fanquake merged commit 01129ca into bitcoin:master Oct 11, 2021
@maflcko maflcko deleted the 2110-dbwInt branch October 11, 2021 09:28
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 11, 2021
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants