stephane / modbusino

Small Modbus slave, RTU (serial) for Arduino
http://libmodbus.org
ISC License
143 stars 94 forks source link

_MODBUSINO_RTU_MAX_ADU_LENGTH is wrong #6

Closed karlp closed 5 years ago

karlp commented 9 years ago

I started using rather larger modbus tables, and starting hitting all sorts of buffer overflows :( (I have a very old fork, that was missing some of the earlier fixes for this)

But immediately, the define for RTU_MAX_ADU is just wrong. Setting this to 256 properly, as per page 5 of modbus app proto 1.1b3 results in requests for more than 64 registers succeeding, but requesting 128 registers for instance, passes validation but overflows. I know this is the "very very very cut down" version, so I'm not hanging out for a heap of fixes, just letting you know.

stephane commented 5 years ago

OK thank you for your report. I'll just leave a comment about that in the code.