homebridge-dacp icon indicating copy to clipboard operation
homebridge-dacp copied to clipboard

FIx for [ERR_OUT_OF_RANGE]: The value of "byteLength" is out of range…

Open torandreroland opened this issue 6 years ago • 2 comments

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

torandreroland avatar Apr 24 '19 20:04 torandreroland

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

jeromeof avatar Jun 01 '20 12:06 jeromeof

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);

machineglow avatar Dec 04 '20 18:12 machineglow