Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion main/jade_abort.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ extern void __real_abort(void);

void jade_abort(const char* file, const int line_n)
{
// Only try to show the error message once - if showing it fails and aborts
// again, go straight on to the real abort rather than looping forever
static bool message_attempted = false;

// Clear senstitive data
keychain_clear();
sensitive_clear_stack();

if (gui_initialized() && !gui_is_gui_task()) {
if (!message_attempted && gui_initialized() && !gui_is_gui_task()) {
message_attempted = true;
char details[128];
const int ret = snprintf(details, sizeof(details), "%s:%d", file, line_n);
const char* message[3] = { "Internal error", "", "Restarting" };
Expand Down
2 changes: 1 addition & 1 deletion main/ui/dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ gui_activity_t* make_show_message_activity(const char* message[], const size_t m
const size_t msgextent = message_size * h;
toppad = msgextent < yextent ? (yextent - msgextent) / 2 : 0; // top padding to centre message
JADE_LOGD("ypct, yextent, msgextent, toppad: %u, %u, %u, %u", ypct, yextent, msgextent, toppad);
JADE_ASSERT(toppad < 100); // sanity check
JADE_ASSERT(toppad <= UINT8_MAX); // stored as a uint8_t padding

switch (message_size) {
case 2:
Expand Down