We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd235f1 commit 5852b90Copy full SHA for 5852b90
1 file changed
src/modbus.c
@@ -1337,11 +1337,9 @@ int modbus_proxy(modbus_t *frontend_ctx,
1337
1338
/* Build a raw request for the backend from the PDU.
1339
The raw request for modbus_send_raw_request is: slave + function + data
1340
- (ie. the PDU from the frontend request, starting at header_length - 1). */
1341
- if (pdu_length + 1 > MAX_MESSAGE_LENGTH) {
1342
- errno = EMBBADDATA;
1343
- return -1;
1344
- }
+ (ie. the PDU from the frontend request, starting at header_length - 1).
+ pdu_length is bounded above by the check on MODBUS_MAX_PDU_LENGTH, so
+ pdu_length + 1 always fits in backend_req[MAX_MESSAGE_LENGTH]. */
1345
memcpy(backend_req, req + frontend_header_length - 1, pdu_length + 1);
1346
backend_req_length = pdu_length + 1;
1347
0 commit comments