rtos/riot: fix out-of-bounds writes when target is corrupted
commit013a0e88d2a6e4626987e9fbe056ee1d40026933
authorSebastiaan de Schaetzen <sebastiaan.de.schaetzen@gmail.com>
Tue, 27 Jul 2021 13:06:57 +0000 (27 15:06 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 22 Aug 2021 20:21:47 +0000 (22 20:21 +0000)
treef1e96bbc0d956822b752c762040717ee1f4ab710
parent085dd21a16c84874fddd76b07a995afae9af182a
rtos/riot: fix out-of-bounds writes when target is corrupted

This protects against out-of-bounds writes when the memory
of RIOT's scheduler is corrupted.
This memory can be corrupted because of:
 - Programming errors
 - The scheduler not yet having been initialised
 - An incorrect symbol file being used during debugging.

This error can result in OpenOCD segfaulting. Valgrind was
used to find the approximate location of the error.

Change-Id: I60e7d7c245b8c4e38f4c98cb0c0347a9b5ec3177
Signed-off-by: Sebastiaan de Schaetzen <sebastiaan.de.schaetzen@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6381
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/rtos/riot.c