OpenZWave / open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
http://www.openzwave.net/
GNU Lesser General Public License v3.0
1.05k stars 918 forks source link

duplicate message logic ignores message length #2587

Open rrozema opened 3 years ago

rrozema commented 3 years ago

In Driver::HandleApplicationCommandHandlerRequest a check exists that looks to ignore duplicate messsages. This check always compares the full buffer length (254 bytes) to see if the message received is a duplicate of the last message, whereas the length of the actual messages varies and thus the buffer may still contain bytes left over from previous messages. Effectively the comparison may fail to detect a duplicate because of this.