| View previous topic :: View next topic |
| Author |
Message |
Nippy
Joined: 15 Sep 2004 Posts: 6 Location: Bordeaux (France)
|
Posted: Wed Jun 01, 2005 9:00 am Post subject: [ps2Client] problem when we load a irx file |
|
|
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; |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed Jun 01, 2005 9:15 am Post subject: |
|
|
This is during execiop, right?
Strange.
Thanks for the patch, though. :) |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Wed Jun 01, 2005 9:52 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Thu Jun 02, 2005 2:12 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Thu Jun 02, 2005 5:58 am Post subject: |
|
|
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. :) |
|
| Back to top |
|
 |
|