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 for [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range… #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

torandreroland
Copy link

Change conversion of long to integer from using buffer.readIntBE to buffer.readUInt32BE as node.js since version 10.0 checks that paramter byteLength in buffer.readIntBE is less than 6. One can argue that this should use buffer.readBigInt64BE but that is only available in node.js 12.0

…. It must be >= 1 and <= 6. Received 8 at boundsError

Change conversion of long to integer from using buffer.readIntBE to buffer.readUInt32BE as node.js since version 10.0 checks that paramter byteLength in buffer.readIntBE is less than 6. One can argue that this should use buffer.readBigInt64BE but that is only available in node.js 12.0
@jeromeof
Copy link

jeromeof commented Jun 1, 2020

Would be great if this was merged so we can install this plugin in the new Homebridge config UI

@machineglow
Copy link

I found I had to change the conversion in the decode function for long and ulong to that as well on lines 927-929:

        } else if (type.type === 'long') {
          value = buffer.readUInt32BE(index + 8);
        } else if (type.type === 'ulong') {
          value = buffer.readUInt32BE(index + 8);

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.

None yet

3 participants