Commit 5563c75
committed
fix: TOCTOU race condition in vTaskListTasks()
Read uxCurrentNumberOfTasks once into uxArraySize and use that local
variable for both the size check and pvPortMalloc() call. The previous
code read the volatile variable twice, allowing a task to be created
between the reads, resulting in an undersized allocation that could
cause a buffer overflow in uxTaskGetSystemState().1 parent b196726 commit 5563c75
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7351 | 7351 | | |
7352 | 7352 | | |
7353 | 7353 | | |
7354 | | - | |
| 7354 | + | |
7355 | 7355 | | |
7356 | 7356 | | |
7357 | 7357 | | |
| |||
7520 | 7520 | | |
7521 | 7521 | | |
7522 | 7522 | | |
7523 | | - | |
| 7523 | + | |
7524 | 7524 | | |
7525 | 7525 | | |
7526 | 7526 | | |
| |||
0 commit comments