Skip to content

Commit ba95b06

Browse files
committed
uart: fix send possible buffer overflow when logging to uart.
The overflow would be temporary and nothing harmful would happen, but some logging would get lost.
1 parent d94bf6e commit ba95b06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

uart.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ iram void uart_send(unsigned int uart, unsigned int byte)
114114
if(!init_done)
115115
return;
116116

117-
queue_push(&uart_send_queue[uart], byte);
117+
if(!queue_full(&uart_send_queue[uart]))
118+
queue_push(&uart_send_queue[uart], byte);
118119
}
119120

120121
iram void uart_send_string(unsigned int uart, const string_t *string)

0 commit comments

Comments
 (0)