notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba11675
)
psxbios : Add checks for strncat
author
gameblabla
<gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:00:11 +0000
(
02:00
+0200)
committer
gameblabla
<gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:00:11 +0000
(
02:00
+0200)
Returns 0 if src or dst is 0x00.
libpcsxcore/psxbios.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/psxbios.c
b/libpcsxcore/psxbios.c
index
924996a
..
90c11ae
100644
(file)
--- 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') {