[ps2Client] problem when we load a irx file

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Nippy
Posts: 6
Joined: Wed Sep 15, 2004 2:27 am
Location: Bordeaux (France)

[ps2Client] problem when we load a irx file

Post by Nippy »

Hi,
in ps2client we can't load a file bigger than 65536 bytes so i made a patch :D

Index: ps2link.c
===================================================================
RCS file: /home/ps2cvs/ps2client/src/ps2link.c,v
retrieving revision 1.28
diff -r1.28 ps2link.c
313c313,314
< int result = -1, size = -1; char buffer[65536];
---
> int result = -1, size = -1;
> char *buffer;
314a316
> buffer = malloc(ntohl(request->size));
322,323c324,326
< return network_send(request_socket, buffer, size);
<
---
> result = network_send(request_socket, buffer, size);
> free(buffer);
> return result;
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

This is during execiop, right?

Strange.

Thanks for the patch, though. :)
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

Post by Shazz »

hello ooPo,

No, it's when you load an elf (execee) which load IRX bigger than 64Kb

cheers
- TiTAN Art Division -
http://www.titandemo.org
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

The reason I ask is that I was told the largest transfer to ever expect from ps2link would be 64k. I'm wondering if some part of ps2link may not be checking a buffer size somewhere and overflowing.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Source in cvs has been updated. If a read or write is over 64k, it allocates a bigbuffer and uses that, otherwise it uses the same old buffer. This is to avoid a bunch of malloc/free calls when possible.

Thanks for pointing it out. :)
Post Reply