setup: move stack smashing protection code to setup.c

pull/25/head
Pavol Rusnak 7 years ago
parent e33e1ec0b1
commit 0760ff0468
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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)
{

@ -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…
Cancel
Save