From: Michael Brown Date: Mon, 3 Aug 2026 21:32:25 +0000 (+0100) Subject: [iphone] Fix debug printing of received log messages X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cfaada2c3dbc4569b0b573ed17c7340b079b35a;p=thirdparty%2Fipxe.git [iphone] Fix debug printing of received log messages The log message length is calculated incorrectly, causing the first byte after the I/O buffer data to be both read and written (with a fixed zero value). A log message of precisely 4079 bytes will therefore result in a zero byte being written outside the I/O buffer's heap allocation. Fix by using the correct length for the log message. Signed-off-by: Michael Brown --- diff --git a/src/drivers/net/iphone.c b/src/drivers/net/iphone.c index 108a5a836..d35737c49 100644 --- a/src/drivers/net/iphone.c +++ b/src/drivers/net/iphone.c @@ -776,7 +776,7 @@ static void imux_rx_log ( struct imux *imux, struct imux_header *hdr, * then shuffle the message down within the buffer and append * a NUL terminator. */ - msg_len = ( len - sizeof ( *hdr ) ); + msg_len = ( len - sizeof ( *log ) ); level = log->level; tmp = ( ( void * ) &log->level ); memmove ( tmp, &log->msg, msg_len );