mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
setup: move stack smashing protection code to setup.c
This commit is contained in:
parent
e33e1ec0b1
commit
0760ff0468
@ -120,13 +120,7 @@ void bootloader_loop(void)
|
||||
usbLoop(firmware_present());
|
||||
}
|
||||
|
||||
uint32_t __stack_chk_guard;
|
||||
|
||||
void __attribute__((noreturn)) __stack_chk_fail(void)
|
||||
{
|
||||
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Stack smashing", "detected.", NULL, "Please unplug", "the device.", NULL);
|
||||
for (;;) {} // loop forever
|
||||
}
|
||||
extern uint32_t __stack_chk_guard;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
|
@ -31,13 +31,7 @@
|
||||
#include "buttons.h"
|
||||
#include "fastflash.h"
|
||||
|
||||
uint32_t __stack_chk_guard;
|
||||
|
||||
void __attribute__((noreturn)) __stack_chk_fail(void)
|
||||
{
|
||||
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Stack smashing", "detected.", NULL, "Please unplug", "the device.", NULL);
|
||||
for (;;) {} // loop forever
|
||||
}
|
||||
extern uint32_t __stack_chk_guard;
|
||||
|
||||
void check_lock_screen(void)
|
||||
{
|
||||
|
10
setup.c
10
setup.c
@ -21,7 +21,17 @@
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/spi.h>
|
||||
#include <libopencm3/stm32/f2/rng.h>
|
||||
|
||||
#include "rng.h"
|
||||
#include "layout.h"
|
||||
|
||||
uint32_t __stack_chk_guard;
|
||||
|
||||
void __attribute__((noreturn)) __stack_chk_fail(void)
|
||||
{
|
||||
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Stack smashing", "detected.", NULL, "Please unplug", "the device.", NULL);
|
||||
for (;;) {} // loop forever
|
||||
}
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user