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:
fcf7ec6
)
psxbios: Add checks for bcopy
author
gameblabla
<gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:13:13 +0000
(
02:13
+0200)
committer
gameblabla
<gameblabla@openmailbox.org>
Thu, 18 Jul 2019 00:14:29 +0000
(
02:14
+0200)
Nocash documentation say that function refuses to copy any data
if dst is NULL or len greater than 0x7FFFFFFF.
(In any cases, return value is always dst)
libpcsxcore/psxbios.c
patch
|
blob
|
blame
|
history
diff --git
a/libpcsxcore/psxbios.c
b/libpcsxcore/psxbios.c
index
67a01e5
..
4019234
100644
(file)
--- a/
libpcsxcore/psxbios.c
+++ b/
libpcsxcore/psxbios.c
@@
-739,15
+739,20
@@
void psxBios_tolower() { // 0x26
void psxBios_bcopy() { // 0x27
char *p1 = (char *)Ra1, *p2 = (char *)Ra0;
+ v0 = a0;
+ if (a0 == 0 || a2 > 0x7FFFFFFF)
+ {
+ pc0 = ra;
+ return;
+ }
while ((s32)a2-- > 0) *p1++ = *p2++;
-
+ a2 = 0;
pc0 = ra;
}
void psxBios_bzero() { // 0x28
char *p = (char *)Ra0;
while ((s32)a1-- > 0) *p++ = '\0';
-
pc0 = ra;
}