AqualinkD/source
csharp36 20781e8a28 Fix critical bugs: signal safety, packet parsing, fd leaks
- Signal handler (intHandler): move non-async-signal-safe calls
  (LOG, fork, sleep, stopPacketLogger, run_aqualinkd_upgrade) out of
  the handler and into the post-main-loop cleanup path.  The handler
  now only sets volatile flags and optionally closes the blocking fd.

- Packet parsing (fix_packet): change loop bound from i <= packet_length
  to i < packet_length - 1 to prevent buffer over-read when checking
  packet_buffer[i+1].

- Pentair packet construction (send_pentair_command): replace pre-increment
  packet[++i] pattern with direct indexing to eliminate a gap byte and
  extra trailing NUL in sent packets.

- Serial port init (_init_serial_port): add close(fd) on all error paths
  after open() succeeds to prevent file descriptor leaks.  The tcsetattr
  failure path also calls unlock_port(fd) since the port was locked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:35:01 -05:00
..
allbutton.c v2.6.1 2025-03-27 11:26:28 -05:00
allbutton.h Update 2024-09-17 17:48:06 -05:00
allbutton_aq_programmer.c Version 2.6.10 2025-08-31 17:10:09 -05:00
allbutton_aq_programmer.h Version 2.6.10 2025-08-31 17:10:09 -05:00
aq_mqtt.h 2.6.0 (dev) 2025-03-09 17:39:41 -05:00
aq_panel.c Version 2.6.10 2025-08-31 17:10:09 -05:00
aq_panel.h Version 2.6.10 2025-08-31 17:10:09 -05:00
aq_programmer.c Version 2.6.10 2025-08-31 17:10:09 -05:00
aq_programmer.h Version 2.6.10 2025-08-31 17:10:09 -05:00
aq_scheduler.c Updates 2.6.2 2025-04-13 12:03:42 -05:00
aq_scheduler.h v2.6.1 2025-03-27 11:26:28 -05:00
aq_serial.c Fix critical bugs: signal safety, packet parsing, fd leaks 2026-02-22 18:35:01 -05:00
aq_serial.h Version 2.6.10 2025-08-31 17:10:09 -05:00
aq_systemutils.c Update 2025-05-04 16:29:35 -05:00
aq_systemutils.h Updates 2.6.2 2025-04-13 12:03:42 -05:00
aq_timer.c Updates for 2.5.0 2024-10-12 17:37:26 -05:00
aq_timer.h Code Cleanup 2024-06-14 17:48:08 -05:00
aqualink.h Version 2.6.10 2025-08-31 17:10:09 -05:00
aqualinkd.c Fix critical bugs: signal safety, packet parsing, fd leaks 2026-02-22 18:35:01 -05:00
color_lights.c Version 2.6.9 2025-07-26 20:41:14 -05:00
color_lights.h Version 2.6.10 2025-08-31 17:10:09 -05:00
config.c Version 2.6.10 2025-08-31 17:10:09 -05:00
config.h Version 2.6.9 2025-07-26 20:41:14 -05:00
debug_timer.c Code Cleanup 2024-06-14 17:48:08 -05:00
debug_timer.h Code Cleanup 2024-06-14 17:48:08 -05:00
devices_jandy.c Version 2.6.9 2025-07-26 20:41:14 -05:00
devices_jandy.h Version 2.6.9 2025-07-26 20:41:14 -05:00
devices_pentair.c Version 2.6.10 2025-08-31 17:10:09 -05:00
devices_pentair.h Code Cleanup 2024-06-14 17:48:08 -05:00
domoticz.h Code Cleanup 2024-06-14 17:48:08 -05:00
dummy_device.c Release 2.6.8 2025-06-29 18:28:52 -05:00
dummy_reader.c Version 2.6.9 2025-07-26 20:41:14 -05:00
epump.h Code Cleanup 2024-06-14 17:48:08 -05:00
hassio.c Version 2.6.9 2025-07-26 20:41:14 -05:00
hassio.h Code Cleanup 2024-06-14 17:48:08 -05:00
iaqtouch.c v2.6.1 2025-03-27 11:26:28 -05:00
iaqtouch.h Code Cleanup 2024-06-14 17:48:08 -05:00
iaqtouch_aq_programmer.c Release 2.6.0 2025-03-22 16:14:14 -05:00
iaqtouch_aq_programmer.h 2.6.0 (dev) 2025-03-09 17:39:41 -05:00
iaqualink.c Version 2.6.7 2025-05-31 14:44:10 -05:00
iaqualink.h Release 2.6.0 2025-03-22 16:14:14 -05:00
json_messages.c Version 2.6.10 2025-08-31 17:10:09 -05:00
json_messages.h Release 2.6.0 2025-03-22 16:14:14 -05:00
mongoose.c Code Cleanup 2024-06-14 17:48:08 -05:00
mongoose.h Code Cleanup 2024-06-14 17:48:08 -05:00
net_services.c Version 2.6.9 2025-07-26 20:41:14 -05:00
net_services.h Release 2.6.0 2025-03-22 16:14:14 -05:00
onetouch.c Version 2.6.6 2025-05-23 18:11:24 -05:00
onetouch.h Code Cleanup 2024-06-14 17:48:08 -05:00
onetouch_aq_programmer.c 2.6.0 (dev) 2025-03-09 17:39:41 -05:00
onetouch_aq_programmer.h Code Cleanup 2024-06-14 17:48:08 -05:00
packetLogger.c Version 2.6.9 2025-07-26 20:41:14 -05:00
packetLogger.h Version 2.6.9 2025-07-26 20:41:14 -05:00
pda.c Release 2.6.8 2025-06-29 18:28:52 -05:00
pda.h Code Cleanup 2024-06-14 17:48:08 -05:00
pda_aq_programmer.c Release 2.6.8 2025-06-29 18:28:52 -05:00
pda_aq_programmer.h Release 2.6.8 2025-06-29 18:28:52 -05:00
pda_menu.c Code Cleanup 2024-06-14 17:48:08 -05:00
pda_menu.h Code Cleanup 2024-06-14 17:48:08 -05:00
rs_msg_utils.c v2.6.1 2025-03-27 11:26:28 -05:00
rs_msg_utils.h v2.6.1 2025-03-27 11:26:28 -05:00
sensors.c Version 2.6.9 2025-07-26 20:41:14 -05:00
sensors.h Version 2.6.9 2025-07-26 20:41:14 -05:00
serial_logger.c Version 2.6.9 2025-07-26 20:41:14 -05:00
serial_logger.h Updates 2024-08-25 18:31:58 -05:00
serialadapter.c Release 2.6.8 2025-06-29 18:28:52 -05:00
serialadapter.h 2.5.0 (Dev 0.3) 2024-11-10 15:06:29 -06:00
simulator.c Updates 2024-08-25 18:31:58 -05:00
simulator.h Code Cleanup 2024-06-14 17:48:08 -05:00
timespec_subtract.c Code Cleanup 2024-06-14 17:48:08 -05:00
timespec_subtract.h Code Cleanup 2024-06-14 17:48:08 -05:00
utils.c Version 2.6.9 2025-07-26 20:41:14 -05:00
utils.h Version 2.6.9 2025-07-26 20:41:14 -05:00
version.h Version 2.6.10 2025-08-31 17:10:09 -05:00
web_config.c Code Cleanup 2024-06-14 17:48:08 -05:00
web_config.h Code Cleanup 2024-06-14 17:48:08 -05:00