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

Int32LE range checking error in DataStreamParser writeNumber #1081

Open
radredgreen opened this issue Jan 17, 2025 · 1 comment
Open

Int32LE range checking error in DataStreamParser writeNumber #1081

radredgreen opened this issue Jan 17, 2025 · 1 comment

Comments

@radredgreen
Copy link

radredgreen commented Jan 17, 2025

First off, thank you for all your hard work.

Line 687 of https://github.com/homebridge/HAP-NodeJS/blob/latest/src/lib/datastream/DataStreamParser.ts should be

} else if (number >= -2147483648 && number <= 2147483648) {

instead of

} else if (number >= -2147483648 && number <= -2147483648) {

The difference is the negative sign infront of the upper bound check.

Cheers.

@radredgreen
Copy link
Author

Now that I think about it some more, it should probably be

} else if (number >= -2147483648 && number <= 2147483647) {

to reflect the range of a signed int 32.

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

No branches or pull requests

1 participant