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

Left bit shift result in UB #119

Open
semihalf-berestovskyy-andriy opened this issue Jan 10, 2017 · 0 comments
Open

Left bit shift result in UB #119

semihalf-berestovskyy-andriy opened this issue Jan 10, 2017 · 0 comments

Comments

@semihalf-berestovskyy-andriy
Copy link
Owner

semihalf-berestovskyy-andriy commented Jan 10, 2017

Note: the issue was created automatically with bugzilla2github tool

Bugzilla Bug ID: 119

Date: 2017-01-08 12:46:03 +0100
From: Dapeng Liu <[email protected]>
To: Dapeng Liu <[email protected]>
CC: [email protected]

Depends on: #118, #114
Blocker for: #115, #116
Last updated: 2017-01-08 12:46:15 +0100

Bugzilla Comment ID: 225

Date: 2017-01-08 12:46:03 +0100
From: Dapeng Liu <[email protected]>

For E1 << E2, according to C programming language, the result is undefined if the right operand is negative, or greater than or equal to the number of bits in the left expression’s type. On my testbed 0xFFFFFFFF << (32 - masklen) in to_network_prefix result in 0xFFFFFFFF when masklen is 0, which is clearly wrong. Will check all bit shift operation and provide fix soon.

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

No branches or pull requests

1 participant