serial: nrfx_uarte: check size before writing to buffer
NRFX UARTE would write to user supplied buffer on IRQ without checking whether or not the supplied buffer had available space left to write one char Signed-off-by: Arne Edholm <arne.edholm@assaabloy.com>
This commit is contained in:
parent
a71a8dbfca
commit
2b864edbcd
1 changed files with 1 additions and 1 deletions
|
@ -1452,7 +1452,7 @@ static int uarte_nrfx_fifo_read(const struct device *dev,
|
|||
NRF_UARTE_Type *uarte = get_uarte_instance(dev);
|
||||
const struct uarte_nrfx_data *data = get_dev_data(dev);
|
||||
|
||||
if (nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) {
|
||||
if (size > 0 && nrf_uarte_event_check(uarte, NRF_UARTE_EVENT_ENDRX)) {
|
||||
/* Clear the interrupt */
|
||||
nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_ENDRX);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue