From: gameblabla Date: Wed, 17 Jul 2019 23:09:21 +0000 (+0200) Subject: psxbios: Add checks to strcat X-Git-Tag: r23~156^2~50 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=bee52312d06313957cfe73dacdb1717d1c8bcddb psxbios: Add checks to strcat Nocash documentation says that function fails if src or dst is 0. If so, then it must return 0. This fix is required for fixing crash on bootup in Digimon World. --- diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 292d80d6..4624bf4d 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -394,7 +394,12 @@ void psxBios_strcat() { // 0x15 #ifdef PSXBIOS_LOG PSXBIOS_LOG("psxBios_%s: %s, %s\n", biosA0n[0x15], Ra0, Ra1); #endif - + if (a0 == 0 || a1 == 0) + { + v0 = 0; + pc0 = ra; + return; + } while (*p1++); --p1; while ((*p1++ = *p2++) != '\0');