Skip to content

Commit

Permalink
Fix awful typo in fix for VD-1301 vulnerability.
Browse files Browse the repository at this point in the history
Thank you @karlp.
  • Loading branch information
stephane committed Jul 31, 2019
1 parent 7098bed commit 64cd092
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ int modbus_reply(modbus_t *ctx, const uint8_t *req,
int nb = (req[offset + 3] << 8) + req[offset + 4];
int nb_bytes = req[offset + 5];

if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb || nb_bytes * 8 < nb) {
if (nb < 1 || MODBUS_MAX_WRITE_REGISTERS < nb || nb_bytes != 2 * nb) {
if (ctx->debug) {
fprintf(stderr,
"Illegal number of values %d in write_registers (max %d)\n",
Expand Down

0 comments on commit 64cd092

Please sign in to comment.