From 381e88ec750d8c694d1218bf2529d550d209d4b6 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Fri, 1 Oct 2021 17:36:59 +0300 Subject: [PATCH] [UART] check if write data is valid --- cores/esp32/esp32-hal-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index c18b0533..c3f2df37 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -269,7 +269,7 @@ void uartWrite(uart_t* uart, uint8_t c) void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len) { - if(uart == NULL) { + if(uart == NULL || data == NULL || !len) { return; }