From 60a8bf56c652324fffcde6cfe5384b18272a72a3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Aug 2019 03:11:45 -0400 Subject: [PATCH] rosalina/errdisp: Correct uninitialized variable usage in ERRF_HandleCommands This was previously using the value of the uninitialized sz variable before it was actually assigned a value, rather than assigning the size indicated within the command buffer. --- sysmodules/rosalina/source/errdisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysmodules/rosalina/source/errdisp.c b/sysmodules/rosalina/source/errdisp.c index 914895f..e3b11b5 100644 --- a/sysmodules/rosalina/source/errdisp.c +++ b/sysmodules/rosalina/source/errdisp.c @@ -273,7 +273,7 @@ void ERRF_HandleCommands(void *ctx) else { cmdbuf[0] = 0x20040; - u32 sz = cmdbuf[1] <= 0x100 ? sz : 0x100; + u32 sz = cmdbuf[1] <= 0x100 ? cmdbuf[1] : 0x100; memcpy(userString, cmdbuf + 3, sz); userString[sz] = 0; }