From 04e2a78f82fb2fca790a10b27720c560536e9d6c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Aug 2013 23:39:12 -0700 Subject: [PATCH 1/2] Fix table checks in sceCcc. Was checking for the wrong table. --- Core/HLE/sceCcc.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Core/HLE/sceCcc.cpp b/Core/HLE/sceCcc.cpp index b8570f205..a47a95fec 100644 --- a/Core/HLE/sceCcc.cpp +++ b/Core/HLE/sceCcc.cpp @@ -115,7 +115,7 @@ int sceCccUTF8toSJIS(u32 dstAddr, int dstSize, u32 srcAddr) ERROR_LOG(HLE, "sceCccUTF8toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr); return 0; } - if (!jis2ucsTable.IsValid()) + if (!ucs2jisTable.IsValid()) { ERROR_LOG(HLE, "sceCccUTF8toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr); return 0; @@ -144,11 +144,6 @@ int sceCccUTF16toUTF8(u32 dstAddr, int dstSize, u32 srcAddr) ERROR_LOG(HLE, "sceCccUTF16toUTF8(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr); return 0; } - if (!jis2ucsTable.IsValid()) - { - ERROR_LOG(HLE, "sceCccUTF16toUTF8(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr); - return 0; - } DEBUG_LOG(HLE, "sceCccUTF16toUTF8(%08x, %d, %08x)", dstAddr, dstSize, srcAddr); UTF16LE utf(src); @@ -173,7 +168,7 @@ int sceCccUTF16toSJIS(u32 dstAddr, int dstSize, u32 srcAddr) ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): invalid pointers", dstAddr, dstSize, srcAddr); return 0; } - if (!jis2ucsTable.IsValid()) + if (!ucs2jisTable.IsValid()) { ERROR_LOG(HLE, "sceCccUTF16toSJIS(%08x, %d, %08x): table not loaded", dstAddr, dstSize, srcAddr); return 0; From fff0af844bfe26556fdda38be609bf3c158d1f91 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Aug 2013 23:52:38 -0700 Subject: [PATCH 2/2] Fix bounds check in sceKernelPrintf(). Wasn't allowing a string ending in %08x. --- Core/HLE/sceKernelMemory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index c79c219c6..37b771a6c 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -617,7 +617,7 @@ int sceKernelPrintf(const char *formatString) break; case '0': - if (i + 3 >= n || format[i + 1] != '8' || format[i + 2] != 'x') + if (i + 3 > n || format[i + 1] != '8' || format[i + 2] != 'x') supported = false; else {