From 39b64b8569f8d454be50626c8f0f176c10a1c7d8 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Mon, 10 Jan 2022 11:47:10 +0100 Subject: [PATCH] fix(core): Fix stack-use-after-scope in display.c. [no changelog] --- core/embed/extmod/modtrezorui/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/embed/extmod/modtrezorui/display.c b/core/embed/extmod/modtrezorui/display.c index 703b3c4aeb..5cb56802cc 100644 --- a/core/embed/extmod/modtrezorui/display.c +++ b/core/embed/extmod/modtrezorui/display.c @@ -407,11 +407,11 @@ void display_loader(uint16_t progress, bool indeterminate, int yoffset, DISPLAY_RESY / 2 - img_loader_size + yoffset, DISPLAY_RESX / 2 + img_loader_size - 1, DISPLAY_RESY / 2 + img_loader_size - 1 + yoffset); + uint8_t icondata[(LOADER_ICON_SIZE * LOADER_ICON_SIZE) / 2] = {0}; if (icon && memcmp(icon, "TOIg", 4) == 0 && LOADER_ICON_SIZE == *(uint16_t *)(icon + 4) && LOADER_ICON_SIZE == *(uint16_t *)(icon + 6) && iconlen == 12 + *(uint32_t *)(icon + 8)) { - uint8_t icondata[(LOADER_ICON_SIZE * LOADER_ICON_SIZE) / 2] = {0}; memzero(&icondata, sizeof(icondata)); struct uzlib_uncomp decomp = {0}; uzlib_prepare(&decomp, NULL, icon + 12, iconlen - 12, icondata,