Skip to content

Fix ParseNumber integer parse bug around max int32 and uint32.#2382

Open
NonRadical wants to merge 1 commit into
Tencent:masterfrom
NonRadical:master
Open

Fix ParseNumber integer parse bug around max int32 and uint32.#2382
NonRadical wants to merge 1 commit into
Tencent:masterfrom
NonRadical:master

Conversation

@NonRadical

Copy link
Copy Markdown

For integers in a range above from and including max int32 as well as a range down from and including max uint32, the current implementation of ParseNumber can "miss" that the accumulated 32 bit integer will overflow due to the evaluation of the potential overflow happening before the accumulation is done. Example values that experience this issue are 2,147,483,648 (max int32) and 4,294,967,295 (max uint32).

For a range of integers around max int32 and uint32, the current implementation can "miss" that the accumulated integer will overflow due to the evaluation of the potential overflow happening before the accumulation is done. Example values that experience this issue are 4,294,967,296 (max uint32 + 1) and 2,147,483,648 (max int32 + 1).
@tencent-adm

tencent-adm commented May 14, 2026

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants