2017-11-15 11:09:54 +03:00
|
|
|
#include "unity.h"
|
|
|
|
|
2019-04-24 15:02:25 +02:00
|
|
|
#if CONFIG_COMPILER_STACK_CHECK
|
2017-11-15 11:09:54 +03:00
|
|
|
|
2019-07-16 16:33:30 +07:00
|
|
|
static void recur_and_smash(void)
|
2017-11-15 11:09:54 +03:00
|
|
|
{
|
|
|
|
static int cnt;
|
|
|
|
volatile uint8_t buf[50];
|
|
|
|
volatile int num = sizeof(buf)+10;
|
|
|
|
|
|
|
|
if (cnt++ < 1) {
|
|
|
|
recur_and_smash();
|
|
|
|
}
|
|
|
|
for (int i = 0; i < num; i++) {
|
|
|
|
buf[i] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST_CASE("stack smashing protection", "[stack_check] [ignore]")
|
|
|
|
{
|
|
|
|
recur_and_smash();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|