diff options
author | gameblabla | 2019-07-18 02:00:11 +0200 |
---|---|---|
committer | gameblabla | 2019-07-18 02:00:11 +0200 |
commit | f42e1e9003d052bcfcadd5955d2396f11ea0f3c5 (patch) | |
tree | 85fd0948dca94a7b06b4062a3cbf2f9852d48393 | |
parent | ba11675ca958088f3c5c1e60a5d437f0c1683514 (diff) | |
download | pcsx_rearmed-f42e1e9003d052bcfcadd5955d2396f11ea0f3c5.tar.gz pcsx_rearmed-f42e1e9003d052bcfcadd5955d2396f11ea0f3c5.tar.bz2 pcsx_rearmed-f42e1e9003d052bcfcadd5955d2396f11ea0f3c5.zip |
psxbios : Add checks for strncat
Returns 0 if src or dst is 0x00.
-rw-r--r-- | libpcsxcore/psxbios.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 924996a..90c11ae 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') { |