From 399740b50e8f2027c9931b80b98bc8fcc1954a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Marques?= Date: Thu, 25 Jan 2024 10:28:03 +0000 Subject: [PATCH] Undefined behavior fix on ticket.c (#838) Stack garbage is always a luck of the draw This was causing issues on non-LTO build. LTO was just lucky. --- arm9/source/game/ticket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm9/source/game/ticket.c b/arm9/source/game/ticket.c index 24005cd48..d5cdb13ad 100644 --- a/arm9/source/game/ticket.c +++ b/arm9/source/game/ticket.c @@ -120,7 +120,7 @@ u32 BuildVariableFakeTicket(Ticket** ticket, u32* ticket_size, const u8* title_i } u32 BuildFakeTicket(Ticket* ticket, const u8* title_id) { - Ticket* tik; + Ticket* tik = NULL; u32 ticket_size = sizeof(TicketCommon); u32 res = BuildVariableFakeTicket(&tik, &ticket_size, title_id, TICKET_MAX_CONTENTS); if (res != 0) return res;