Releases: stephane/libmodbus
Releases · stephane/libmodbus
Release list
v3.2.0
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
EMBXILVALinstead ofEMBMDATAfor illegal data value errors. modbus_reply: reject NULLreqandmb_mappingarguments.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 signedint16_tin every context
(reported by Henrik Brodin - Trail of Bits). - Fix strict aliasing violation in
modbus_set_float_*()by usingmemcpy
(reported by Henrik Brodin). - Remove dead code (Coverity CID 561619).
- modbus-rtu: don't use
O_EXCLwhen opening the device (#760). - WIN32 compatibility for
setsockopt()in modbus-tcp.c (#800). - Check if
ai_listis null before freeing it (#831). - Respect user-provided CFLAGS (closes #836).
- Fix test to use
ctxinstead ofinvalid_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 thatctxis not NULL.modbus_write_and_read_registers: validatesrc/destpointers and counts.modbus_report_slave_id: reject a NULLdestbuffer.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 whenipis NULL.modbus_reply: validate FC22 request length before writing the register.- modbus-tcp: keep
ctx->sconsistent 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: validatedata_bitandstop_bitarguments.modbus_send_raw_request_tid: reject NULLraw_reqwithEINVAL.modbus_get_byte_from_bits: remove an always-false assert and clampnb_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
- @micrictor made their first contribution in #831
- @desteemy made their first contribution in #800
Full Changelog: v3.1.12...v3.2.0
v3.1.12
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
- @kyllingstad made their first contribution in #758
Full Changelog: v3.1.11...v3.1.12
v3.1.11
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_replywhen used inmemcpy.
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
- @yauyimsing made their first contribution in #702
- @cedricboudinet made their first contribution in #682
- @lanurmi made their first contribution in #398
- @ghorwin made their first contribution in #694
- @diplfranzhoepfinger made their first contribution in #765
Full Changelog: v3.1.10...v3.1.11
v3.1.10
v3.1.9
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
- @jordanjohnson56 made their first contribution in #653
- @metapsychologe made their first contribution in #509
- @DavidKorczynski made their first contribution in #669
v3.1.8
- 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
- @JetForMe made their first contribution in #624
- @Begasus made their first contribution in #622
- @ndunks made their first contribution in #616
- @bachp made their first contribution in #463
- @alongL made their first contribution in #631
- @embeddedmz made their first contribution in #644
Full Changelog: v3.1.7...v3.1.8
v3.1.7
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_STDCbyAC_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
- @i-ky made their first contribution in #441
- @timgates42 made their first contribution in #569
- @anton-bondarev made their first contribution in #580
- @richardash1981 made their first contribution in #545
- @stefannilsson made their first contribution in #539
- @Zugschlus made their first contribution in #460
Full Changelog: v3.1.6...v3.1.7
v3.1.6
v3.0.8
v3.1.5
- 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_tis now a named typedef (to allow forward declaration)- Rename type as flags for consistency between functions
- Add missing
SOCK_CLOEXECflag on socket creation - Remove wrong and harmful checks in configure.ac
- Oops fix OR on RS485 settings (1c5d969)
- Only set
SER_RS485_ENABLEDbit 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_replyfor 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
bswap16of 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_acceptmustn't close socket on error (closes #333)