Skip to content

Commit

Permalink
uart: fix send possible buffer overflow when logging to uart.
Browse files Browse the repository at this point in the history
The overflow would be temporary and nothing harmful would happen, but
some logging would get lost.
  • Loading branch information
eriksl committed Jun 16, 2019
1 parent d94bf6e commit ba95b06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ iram void uart_send(unsigned int uart, unsigned int byte)
if(!init_done)
return;

queue_push(&uart_send_queue[uart], byte);
if(!queue_full(&uart_send_queue[uart]))
queue_push(&uart_send_queue[uart], byte);
}

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

0 comments on commit ba95b06

Please sign in to comment.