mirror of
https://github.com/arendst/Tasmota.git
synced 2026-10-26 22:11:22 +00:00
Fix Modbus OOB
This commit is contained in:
1 parent
ba3ead1afc
commit
6776e2ea9a
1 file changed
+5
@@ -782,6 +782,11 @@ void ModbusTCPHandle(void)
|
||||
{
|
||||
// For functioncode 15 & 16 ignore bytecount, modbusBridgeModbus does calculate this
|
||||
uint8_t dataStartByte = mbfunctioncode <= 6 ? 10 : 13;
|
||||
if (dataStartByte > buf_len) {
|
||||
AddLog(LOG_LEVEL_ERROR, PSTR("MBS: data start larger than buffer"));
|
||||
return;
|
||||
}
|
||||
|
||||
uint16_t byteCount = (buf_len - dataStartByte);
|
||||
modbusBridge.byteCount = 2;
|
||||
modbusBridge.dataCount = 1;
|
||||
|
||||
Reference in new issue
Block a user