Skip to content

Commit 381e88e

Browse files
committed
[UART] check if write data is valid
1 parent f87107d commit 381e88e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp32/esp32-hal-uart.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void uartWrite(uart_t* uart, uint8_t c)
269269

270270
void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len)
271271
{
272-
if(uart == NULL) {
272+
if(uart == NULL || data == NULL || !len) {
273273
return;
274274
}
275275

0 commit comments

Comments
 (0)