From 9e3863cc4e0e4e6908ad699ce5ee763fb270a96b Mon Sep 17 00:00:00 2001 From: bloqaudio Date: Fri, 18 Sep 2026 13:59:59 -0500 Subject: [PATCH] syslog: do not read the connection before there is one udp_callbacks() offers every UDP connection event to syslog_callback(), which decides whether the event is its own by comparing the local port against state.syslog_conn->lport. The pointer is null until syslog is started: syslog_init() clears it at boot and syslog_stop() clears it again, so with syslog off, which is the default, every poll dereferences null and reads whatever lives at the bottom of xdata. Should that word ever match the port being offered, the send path runs on another application's connection, overwrites uip_appdata and drops the log line it was holding. Test the pointer first. --- syslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syslog.c b/syslog.c index de11af53..eed060b9 100644 --- a/syslog.c +++ b/syslog.c @@ -60,7 +60,7 @@ void syslog_stop(void) __banked void syslog_callback(uint16_t lport) __banked { uint16_t syslog_hdr; - if (lport != state.syslog_conn->lport) + if (!state.syslog_conn || lport != state.syslog_conn->lport) return; if ((state.readptr != state.writeptr) && state.line_available)