From f42e1e9003d052bcfcadd5955d2396f11ea0f3c5 Mon Sep 17 00:00:00 2001 From: gameblabla Date: Thu, 18 Jul 2019 02:00:11 +0200 Subject: [PATCH] psxbios : Add checks for strncat Returns 0 if src or dst is 0x00. --- libpcsxcore/psxbios.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 924996a3..90c11aeb 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -493,7 +493,12 @@ void psxBios_strncat() { // 0x16 #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %s (%x), %s (%x), %d\n", biosA0n[0x16], Ra0, a0, Ra1, a1, a2); #endif - + if (a0 == 0 || a1 == 0) + { + v0 = 0; + pc0 = ra; + return; + } while (*p1++); --p1; while ((*p1++ = *p2++) != '\0') { -- 2.39.5