Commit graph

411 commits

Author SHA1 Message Date
Jonathan Naylor
65eaf779b0
Merge pull request #144 from BeigeBox/fix/stale-slot-after-rewrite
Fix stale slot number after RF rewrite
2026-04-05 16:25:33 +01:00
Jonathan Naylor
3dd99d6952
Merge pull request #143 from BeigeBox/fix/stack-overflow-radio-position
Fix stack buffer overflow in DMRNetwork radio position and talker alias writes
2026-04-05 16:24:52 +01:00
Jonathan Naylor
8725e06978
Merge pull request #142 from BeigeBox/fix/heap-overflow-dmrg-dmra
Fix heap buffer overflow on DMRG/DMRA packets
2026-04-05 16:24:12 +01:00
Jonathan Naylor
e5d050ee43
Merge pull request #141 from BeigeBox/fix/empty-mqtt-command-crash
Fix crash on empty MQTT command message
2026-04-05 16:23:27 +01:00
Ember
891a2a87b7 Fix upper bound in length check: 50 → 46 to match buffer geometry
The memcpy writes (length - 4) bytes at offset 8 into a 50-byte buffer,
so the maximum safe length is 46 (8 + 42 = 50), not 50. With length=50
the previous check still allowed a 4-byte stack overflow.
2026-04-04 17:02:53 -07:00
Ember
59011f3719 Fix stale slot number in RF-to-network rewrite path
After rewrite rules transform data (potentially changing the slot),
the code used the pre-rewrite slotNo for status tracking and timers.
Re-read slotNo after rewrite, matching the network-to-RF path.
2026-04-04 16:49:28 -07:00
Ember
6dd98bd856 Fix stack buffer overflow in writeRadioPosition and writeTalkerAlias
Both functions copy packet data into 50-byte stack buffers without
validating the length parameter. Add bounds checks to reject packets
that would overflow the buffer or cause unsigned underflow.
2026-04-04 16:49:26 -07:00
Ember
f697c1de8c Fix heap buffer overflow on DMRG/DMRA packets
Incoming DMRG and DMRA packets were copied into 50-byte buffers
without checking the packet length. UDP reads can return up to 500
bytes, overflowing the heap allocation. Drop oversized packets.
2026-04-04 16:49:19 -07:00
Ember
c9a2d5802e Fix crash on empty MQTT command
An empty or whitespace-only MQTT command message caused an unhandled
std::out_of_range exception that terminated the process. Check for
empty args before accessing. Also add null check on m_mqtt before
publishing response.
2026-04-04 16:47:58 -07:00
Jonathan Naylor
0e04ebae0f Add MQTT retain to some JSON messages. 2026-03-23 17:51:28 +00:00
Jonathan Naylor
f320e82be4 Remove some old remote control weirdness. 2026-03-23 17:49:19 +00:00
Jonathan Naylor
7bbd64c386 create timestamps in rfc3339 format 2026-03-23 12:52:29 +00:00
Jonathan Naylor
4786d779b5 Improve the build process. 2026-03-11 17:25:22 +00:00
Jonathan Naylor
a2b30fcc1f
Merge pull request #140 from MW0MWZ/fix/mqtt-client-id
Fix MQTT client ID collision on 32-bit ARM userland
2026-03-08 15:19:39 +00:00
Andy Taylor
139d9dbff5 Add mosquitto_loop_stop before mosquitto_destroy in close()
The background network thread started by mosquitto_loop_start() was not
being stopped before mosquitto_destroy(), which can cause a use-after-free
if the thread is still running when the mosquitto structure is freed.
2026-03-08 14:16:32 +00:00
Andy Taylor
50a3567335 Fix MQTT client ID collision on ARM 32-bit userland with 64-bit kernel
The MQTT client ID was generated using sprintf with %ld and time(nullptr).
On platforms with 32-bit userland but 64-bit kernel (such as Raspberry Pi OS
and some custom Alpine Linux builds), time_t is a 64-bit long long but %ld
only reads 32 bits. Since the upper 32 bits of the current Unix timestamp
are zero, this always produces a client ID ending in .0, causing collisions
when multiple instances or restarts occur.

Replace time()-based client IDs with PID-based IDs using getpid(), which is
always a portable 32-bit value and unique per process. Platform-guarded for
Windows (_getpid) and POSIX (getpid).
2026-03-08 12:51:36 +00:00
Jonathan Naylor
32c3d7360e Update README.md 2026-02-14 18:20:45 +00:00
Jonathan Naylor
1028225a8d Merge branch 'master' into mqtt 2026-02-14 18:11:16 +00:00
Jonathan Naylor
3d099ae24d
Merge pull request #137 from f1rmb/f1rmb_nullptr_vs_NULL_with_getaddrinfo
Fix nullptr instead of NULL argument usage in getaddrinfo().
2025-06-09 13:38:04 +01:00
Daniel Caujolle-Bert
2aeaa71e87 Fix nullptr instead of NULL argument usage in getaddrinfo().
Bump version.
2025-06-07 17:29:32 +02:00
Jonathan Naylor
804478c328
Merge pull request #136 from olympy/unlim-networks
Unlimited number of DMR networks
2025-06-02 17:12:39 +01:00
Alexander Mokrov UR6LKW
fbdd2f36bf [unlim-networks] RemoteControl 2025-06-02 18:31:23 +03:00
Alexander Mokrov UR6LKW
366b32a29a [unlim-networks] DMRGateway 2025-06-02 01:40:35 +03:00
Alexander Mokrov UR6LKW
fa558552d8 [unlim-networks] Config 2025-06-02 01:40:29 +03:00
Alexander Mokrov UR6LKW
68e68c9c79 [unlim-networks] indentation fix 2025-06-02 01:39:51 +03:00
Jonathan Naylor
538108b192 Add optional MQTT authentication. 2025-03-21 17:37:30 +00:00
Jonathan Naylor
a2e2ea3675 Linux cleanups. 2025-03-17 14:29:13 +00:00
Jonathan Naylor
4ff688045f Update the C++ version and other changes. 2025-03-17 14:09:42 +00:00
Jonathan Naylor
fd54e3eb7c Merge branch 'master' into mqtt 2025-03-15 17:23:14 +00:00
Jonathan Naylor
ec5c32b57a Update the C++ code. 2025-03-15 17:03:06 +00:00
Jonathan Naylor
330fdd7158 Merge branch 'master' into mqtt 2024-08-31 20:06:29 +01:00
Jonathan Naylor
29397cf65e Fix signal logging. 2024-08-31 20:04:32 +01:00
Jonathan Naylor
e4e17ae74b Merge branch 'master' into mqtt 2024-08-28 16:53:49 +01:00
Jonathan Naylor
6d42e46285 Upgrade the signal handling. 2024-08-28 16:53:25 +01:00
Jonathan Naylor
870de67a2d Merge branch 'master' into mqtt 2024-08-28 16:10:16 +01:00
Jonathan Naylor
e1e41be3a0
Merge pull request #131 from nweisenfeld/nweisenfeld/correct-SIGHUP-handling
Fix SIGHUP treatment to loop/restart as intended
2024-08-28 15:47:32 +01:00
Neil Weisenfeld
9f73f66101 Fix SIGHUP treatment to loop/restart as intended
There's a do...while(m_signal==1) intended to allow a SIGHUP (1) to
cause a restart, rather than an exit.  But the current code doesn't
reset m_killed, so it does instantiate a new DMRGateway object, but
immediately exits.
2024-08-27 10:17:24 -04:00
Jonathan Naylor
8f428cf86b Fix a small bug. 2024-07-08 17:04:40 +01:00
Jonathan Naylor
0dffbf9ddb Allow it to build on Windows again. 2024-04-22 13:57:09 +01:00
Jonathan Naylor
b205134508 Merge branch 'master' into mqtt 2024-02-02 11:35:50 +00:00
Jonathan Naylor
2b81fe225b Re-organise the UDP handling. 2024-02-02 11:35:07 +00:00
Jonathan Naylor
f6b4698f14 Merge branch 'master' into mqtt 2024-01-29 16:49:31 +00:00
Jonathan Naylor
11683af7e4 Simplify the UDP socket handling. 2024-01-29 16:47:34 +00:00
Jonathan Naylor
3a6e47d39e
Merge pull request #127 from qradiolink/embedded_data_passing
Embedded data was not being passed through during rewrite
2024-01-25 18:23:34 +00:00
adrian
ad3fea93fb Embedded data was not being passed through during rewrite 2023-11-01 19:11:12 +02:00
Jonathan Naylor
8ca1bb8d72 Add DMR Master logging-in to the JSON status messages. 2023-07-23 14:30:49 +01:00
Jonathan Naylor
852caca96e Ad simple JSON logging. 2023-07-11 16:54:30 +01:00
Jonathan Naylor
61ccb47afd Don't close MQTT except at the end. 2023-07-07 19:19:26 +01:00
Jonathan Naylor
04146faa81 Convert to use of MQTT for command, APRS, and dynamic TG control. 2023-07-07 11:14:34 +01:00
Jonathan Naylor
a28aa7c549
Merge pull request #126 from f1rmb/f1rmb_gpsd_fix_status_check_api_version
Handle GPSd API version about fix status.
2023-05-21 12:57:52 +01:00