From: gameblabla Date: Thu, 18 Jul 2019 00:00:11 +0000 (+0200) Subject: psxbios : Add checks for strncat X-Git-Tag: r23~156^2~41 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=f42e1e9003d052bcfcadd5955d2396f11ea0f3c5 psxbios : Add checks for strncat Returns 0 if src or dst is 0x00. --- 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') {