Skip to content

Releases: stephane/libmodbus

v3.2.0

Choose a tag to compare

@stephane stephane released this 02 Jul 10:20
a9b025d

libmodbus 3.2.0 (2026-07-02)

  • Add modbus_proxy() to bridge two Modbus backends (closes #70).
  • Add termios2 support to allow custom baud rates (RTU).
  • Return an exception response for READ EXCEPTION STATUS (0x07).
  • Use EMBXILVAL instead of EMBMDATA for illegal data value errors.
  • modbus_reply: reject NULL req and mb_mapping arguments.
  • modbus_reply: validate request length before reading per-function fields.
  • Fix signed integer overflow in modbus_get_float_*() (reported by Dominik
    Blain and Henrik Brodin).
  • Fix signed integer overflow in the MODBUS_GET_INT*_FROM_INT* macros;
    MODBUS_GET_INT16_FROM_INT8() now returns a signed int16_t in every context
    (reported by Henrik Brodin - Trail of Bits).
  • Fix strict aliasing violation in modbus_set_float_*() by using memcpy
    (reported by Henrik Brodin).
  • Remove dead code (Coverity CID 561619).
  • modbus-rtu: don't use O_EXCL when opening the device (#760).
  • WIN32 compatibility for setsockopt() in modbus-tcp.c (#800).
  • Check if ai_list is null before freeing it (#831).
  • Respect user-provided CFLAGS (closes #836).
  • Fix test to use ctx instead of invalid_ctx (closes #791, #792).
  • Update documentation of float functions (closes #838).
  • Fix documentation examples of modbus_get_float_* functions.
  • modbus_reply_exception: reject a NULL request pointer.
  • modbus_mask_write_register: validate that ctx is not NULL.
  • modbus_write_and_read_registers: validate src/dest pointers and counts.
  • modbus_report_slave_id: reject a NULL dest buffer.
  • modbus_get_*_timeout: validate that the output pointers are not NULL.
  • modbus_mapping_new_start_address: cap table dimensions.
  • modbus_mapping_new: reject negative counts.
  • modbus_rtu_set_custom_rts: reject a NULL callback.
  • modbus-rtu: avoid integer overflow in the RTS post-send delay.
  • modbus-rtu: check the return values of the RTS ioctl calls.
  • modbus-rtu: check the return value when saving termios settings on connect.
  • modbus-rtu: report a failure to restore termios settings on close.
  • modbus_new_rtu: reject negative baud rates.
  • modbus-tcp: guard freeaddrinfo() against NULL on resolver failure.
  • modbus_new_tcp: NUL-terminate the IP string when ip is NULL.
  • modbus_reply: validate FC22 request length before writing the register.
  • modbus-tcp: keep ctx->s consistent across failed or repeated connects (no
    false success on a stale descriptor, no socket leak on reconnect).
  • modbus-tcp: don't override the user error recovery mode in the flush overflow
    path.
  • modbus-tcp: fully initialize the sigaction struct for the SIGPIPE handler on
    BSD.
  • modbus-rtu: fix the Windows serial handle lifecycle (initialize the handle,
    guard close against a never-opened handle and reset it after close).
  • modbus-rtu: sleep the RTS turnaround delay in chunks to stay portable with
    usleep().
  • modbus_new_rtu: validate data_bit and stop_bit arguments.
  • modbus_send_raw_request_tid: reject NULL raw_req with EINVAL.
  • modbus_get_byte_from_bits: remove an always-false assert and clamp nb_bits
    consistently in debug and release builds.
  • Preserve errno across the Windows error-recovery paths.
  • tests: don't kill the unit test server on RTU bad-CRC frames.
  • tests: fix integer overflow in the bandwidth-client rate computation.

New Contributors

Full Changelog: v3.1.12...v3.2.0

v3.1.12

Choose a tag to compare

@stephane stephane released this 13 Feb 16:13
9af6c16

What's Changed

  • Fix FD_SET overflow when socket fd >= FD_SETSIZE.
  • Check dest pointer not null and nb in read functions.
  • NULL check for src and nb < 1 validation in write functions.
  • modbus_reply: don't compute address for FC 0x07/0x11.
  • Use O_NONBLOCK instead of deprecated O_NDELAY (closes #710).
  • Explicit cast for Coverity CID 416366.
  • Document required buffer size of modbus_receive.
  • Document macros for error codes corresponding to Modbus exceptions (#758).
  • Fix example of modbus_rtu_set_serial_mode (closes #552).
  • Test filesystem provides symlink in autogen.sh (closes #414).
  • Sync API signatures with the documentation.
  • Many documentation fixes and typo corrections.
  • Add coverage target and helper script.

New Contributors

Full Changelog: v3.1.11...v3.1.12

v3.1.11

Choose a tag to compare

@stephane stephane released this 22 Oct 09:33
5190e5e

What's Changed

  • RTU - Check CRC before filtering on slave ID
  • HAVE_NETINET_IN_H as guard around header (closes #765)
  • Use default port 502 in documentation.
  • Fix float endianness issue introduced in v3.1.8 (49af73d). Thank you @ghorwin for your excellent work on the subject. Closes #665, #694, #757, #770.
  • Proper display of used CFLAGS.
  • Don't build with debug flag by default anymore.
  • Check request length in modbus_reply when used in memcpy.
    Thank you Nozomi Networks Labs Advisory for the report.
  • Fix insecure data handling. CID 416366: INTEGER_OVERFLOW found with Coverity Scan.
  • Remove useless cast in setsockopt call (closes #721)
  • Link against socket and nsl libs when building on SunOS. Thank you @lanurmi.
  • Update documentation about tcp-pi requiring 1 KiB of extra memory (closes #715). Thank you @psychon.
  • Documentation improvements by @cedricboudinet and @mhei.
  • Revert TCP checks for recovery (closes #711).
  • Don't use loop initial declaration (closes #752).
  • Fix wrong generated version for double number in win32 (closes #675).
  • Don't use gai_strerror if not available.
  • Add checks for netinet/ip.h and gai_strerror (#745)
  • Log error in read input registers if debug (closes #755).
  • Fix errno value on timeout with TCP connect (closes #736, #756).
    Thank you @kyllingstad for the issue and @psychon for the fix.
  • Free addrinfo struct on getaddrinfo() gerrors.
  • Fix doc of modbus_mapping_new_start_address (#615).

New Contributors

Full Changelog: v3.1.10...v3.1.11

v3.1.10

Choose a tag to compare

@stephane stephane released this 07 Dec 19:09

Urgent release to fix a regression.

  • Fix baud rate handling with RTU under Linux
  • Fix modbus_disable_quirks signature

v3.1.9

Choose a tag to compare

@stephane stephane released this 03 Dec 15:01

What's Changed

  • Remove Travis CI
  • Move content about migration to libmodbus.org
  • Avoid negative value in FD_SET call
  • Test socket against positive value instead of -1
  • Improvements to autotools by @ndim
  • Fix doc links by @jordanjohnson56 (#653)
  • Test the protocol id for 0 by @metapsychologe (#509)
  • Fix double negative in tests
  • New quirks handler (closes #38 #533)
  • Fix bitwise OR in documentation
  • Improve doc about slave ID in RTU
  • Add .clang-format and format code (closes #394)
  • Remove constraints on baud rate values
  • Accept IP or device in arg of unit test progs
  • Avoid compilation issue with VS2022 with strdup
  • Display created files in configure.js
  • Use strcpy_s under Windows
  • Replace inet_addr by inet_pton calls
  • Replace inet_ntoa by inet_ptop
  • Update configure.ac/config.h.win32 for new inet functions
  • Instructions to build libmodbus in a VS project
  • Fix connection check for Windows RTU (closes #660, #662)
  • Add CIFuzz Github action by @DavidKorczynski (#669)
  • Convert a few int to unsigned int (#402)

New Contributors

v3.1.8

Choose a tag to compare

@stephane stephane released this 17 Aug 16:36
  • Major rewrite of documentation with Material for mkdocs
  • Reduce memory use of TCP PI backend (closes #621)
  • Fixed MODBUS_ERROR_RECOVERY_LINK not working on Windows (@embeddedmz)
  • Replace Travis CI by GitHub CI
  • Fix linker error for Windows (VCLinkerTool)
  • Address check in single register / coil responses added (#463)
  • Swap CRC bytes in request data but not at CRC computing (#397)
  • Fix float endianness issue on big endian architecture
  • Fix comment about EMBUNKEXC (closes #566)
  • Fix network library detection on Haiku
  • Fix typos (closes #620)

New Contributors

Full Changelog: v3.1.7...v3.1.8

v3.1.7

Choose a tag to compare

@stephane stephane released this 08 Jan 23:19

What's Changed

  • SPDX: change LGPL-2.1+ to LGPL-2.1-or-later by @yegorich in #489
  • fix MODBUS_GET_* macros in case of negative values by @i-ky in #441
  • docs: fix simple typo, reponse -> response by @timgates42 in #569
  • Update README.md by @anton-bondarev in #580
  • Install NEWS and AUTHORS files with library, ship LICENSE with tests by @richardash1981 in #545
  • minor typo by @stefannilsson in #539
  • cosmetic changes in man page standardizing itemization by @Zugschlus in #460
  • modbus_reply: fix copy & paste error in sanity check (fixes #614) by @mhei in #619
  • add SECURITY.md (closes #613)
  • fix typo in comment (closes #588)
  • replace obsolete AC_PROG_CC_STDC by AC_PROG_CC
  • fix position of CC flags in documentation (closes #599)
  • remove duplicate ';' (closes #602)
  • add the baud rate of 256k for Windows (closes #603)
  • replace .dir-locals.el (Emacs) by .editorconfig
  • move malloc before starting unit tests

All changes w/o attribution by @stephane.

New Contributors

Full Changelog: v3.1.6...v3.1.7

v3.1.6

Choose a tag to compare

@stephane stephane released this 31 Jul 21:33
  • Fix awful typo in fix for VD-1301 vulnerability.
    Thank you @karlp.

v3.0.8

Choose a tag to compare

@stephane stephane released this 31 Jul 21:32
  • Fix awful typo in fix for VD-1301 vulnerability.
    Thank you @karlp.

v3.1.5

Choose a tag to compare

@stephane stephane released this 31 Jul 08:47
  • Add appveyor.com config
  • Change arg value from int to const uint16_t in modbus_write_register
  • Mark raw_req argument as const in modbus_send_raw_request (closes #479)
  • Add unit tests for VD-1301 and VD-1302 vulnerabilities
  • Fix VD-1301 and VD-1302 vulnerabilities
  • Create CODE_OF_CONDUCT.md
  • modbus_mapping_t is now a named typedef (to allow forward declaration)
  • Rename type as flags for consistency between functions
  • Add missing SOCK_CLOEXEC flag on socket creation
  • Remove wrong and harmful checks in configure.ac
  • Oops fix OR on RS485 settings (1c5d969)
  • Only set SER_RS485_ENABLED bit of existing RS485 settings
  • Add .vscode/ to .gitignore
  • Fix wrong function name
  • Remove a duplicated semi-colon
  • Fix a small typo in test message
  • Fix modbus_reply for TCP when unit id == 0 (fixes #376)
  • New functions to define the indication timeout (#95)
  • Remove CYGWIN condition to provide bswap16 fallback (#383)
  • Use builtin bswap16 of gcc 4.8 (#377)
  • Handle out-of-memory conditions more gracefully
  • Add entry points for accept/listen in libmodbus index
  • Refine issue template for Github
  • Move WINVER definition before other includes (#350)
  • Add new function modbus_get_slave()
  • Fix LIBMODBUS_VERSION_HEX encoding (closes #345)
  • tcp_modbus_accept mustn't close socket on error (closes #333)