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

fix: bug with negative length #2

Closed
wants to merge 5 commits into from

Conversation

paulpach
Copy link
Contributor

len < 0 is always false, because len is a uint and uint can never be negative.

The original C version casts to int here, so that the uint is converted to 2's compliment negative numbers.

vis2k and others added 5 commits October 21, 2020 20:50
len < 0 is always false,  because len is a uint and uint can never be negative.

The original C version casts to int here, so that the uint is converted to 2's compliment negative numbers.
@miwarnec miwarnec force-pushed the master branch 2 times, most recently from a947b8e to a27aad4 Compare October 29, 2020 09:42
@miwarnec miwarnec force-pushed the master branch 2 times, most recently from db25142 to 953511f Compare November 9, 2020 20:14
@miwarnec miwarnec force-pushed the master branch 2 times, most recently from 200d29c to cd81abb Compare January 12, 2021 06:06
@miwarnec miwarnec force-pushed the master branch 3 times, most recently from 6f47d9c to 6900bf2 Compare July 16, 2021 04:32
@miwarnec miwarnec force-pushed the master branch 2 times, most recently from b31337a to 38b3ac4 Compare November 28, 2021 15:51
miwarnec pushed a commit that referenced this pull request Jan 6, 2022
@miwarnec
Copy link
Collaborator

miwarnec commented Jan 6, 2022

fixed on master. original kcp only had one (int) cast, not two

@miwarnec miwarnec closed this Jan 6, 2022
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