Skip to content

Commit eec0e17

Browse files
nordic-krchrlubos
authored andcommitted
tests: drivers: lpuart: Fix memory corruption
Data allocated on stack was used as a user data passed to the interrupt. By the time interrupt is handled this data could be overwritten leading to a fault. Adding static keyword to that variable. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit 077d132)
1 parent 35d42a7 commit eec0e17

File tree

1 file changed

+1
-1
lines changed
  • tests/drivers/lpuart/src

1 file changed

+1
-1
lines changed

tests/drivers/lpuart/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ static void counter_alarm_callback(const struct device *dev,
395395

396396
static void floating_pins_start(int32_t tx_pin)
397397
{
398-
struct test_data data;
398+
static struct test_data data;
399399

400400
data.alarm_cfg.callback = counter_alarm_callback;
401401
data.alarm_cfg.flags = COUNTER_ALARM_CFG_EXPIRE_WHEN_LATE;

0 commit comments

Comments
 (0)