noble / node-bluetooth-hci-socket

MIT License
154 stars 188 forks source link

Fix a crash when reading a buffer too small #8

Closed Loghorn closed 8 years ago

Loghorn commented 8 years ago

The onHciEventEndpointData callback tries to read the second byte to check if the entire buffer has been received even if only one byte of data has been received, causing an uncaught exception. Added a check to verify that the buffer is at least two byte long before reading.

sandeepmistry commented 8 years ago

@Loghorn thanks!

Loghorn commented 8 years ago

Thank you!

May I ask you to release on npm a new version of noble with this fix? Thank you very much

sandeepmistry commented 8 years ago

Sure. I've published v0.4.0 of this module and v1.2.0 of noble which includes the fix.

Loghorn commented 8 years ago

Thank you very much!