Skip to content

Fix #24049: signed integer overflow in SeenLocal - #26399

Closed
ViralTaco wants to merge 4 commits into
bitcoin:masterfrom
ViralTaco:patch-1
Closed

ViralTaco wants to merge 4 commits into
bitcoin:masterfrom
ViralTaco:patch-1

Conversation

@ViralTaco

Copy link
Copy Markdown

This commit makes the behavior defined (unsigned integer overflow as if:
it->second.nscore = static_cast<int>(static_cast<unsigned> (it->second.nscore) + 1U);)
See: Issue #24049; Discussion on stackoverflow.

This commit makes the code valid.
@ViralTaco
ViralTaco marked this pull request as ready for review October 27, 2022 02:22
@hebasto

hebasto commented Oct 27, 2022

Copy link
Copy Markdown
Member

@ViralTaco

Did you see a discussion in #24090? Especially, #24090 (comment) and #24090 (comment)?

@DrahtBot

DrahtBot commented Oct 27, 2022 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25390 (sync: introduce a thread-safe generic container and use it to remove a bunch of "GlobalMutex"es by vasild)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@luke-jr

luke-jr commented Oct 27, 2022

Copy link
Copy Markdown
Contributor

Doesn't appear to actually fix the issue though?

@maflcko

maflcko commented Nov 18, 2022

Copy link
Copy Markdown
Member

Looking at the previous comments, this doesn't seem to be a fix. Let's continue discussion in the issue for now.

@maflcko maflcko closed this Nov 18, 2022
@ViralTaco

Copy link
Copy Markdown
Author

Looking at the previous comments, this doesn't seem to be a fix. Let's continue discussion in the issue for now.

It doesn't "seem[sic]" to fix the issue?
What issue? The code before this patch has undefined behavior.
It can do anything, but it doesn't have to. It could do nothing.

The first sentence in your comment only makes sense in a vacuum. The standard is a thing. I agree with the second part. Let's.

@maflcko

maflcko commented Nov 20, 2022

Copy link
Copy Markdown
Member

The burden to prepare, explain and motivate a change for reviewers is on the author. You created a one-line patch in 4 commits, ignored previous discussions, ignored two review comments, with no apparent progress in about a month. I closed this for now, because it can't be merged according to the guidelines. At a minimum for this simple one line change, you'll have to create at most one commit, with an explanation, and you'll have to reply to review comments. All of this is explained in https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants