Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when issuing dir or nlist command #1

Open
ghost opened this issue Apr 14, 2016 · 2 comments
Open

Crash when issuing dir or nlist command #1

ghost opened this issue Apr 14, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 14, 2016

the client receives the "150 Opening ASCII mode data transfer for LIST" and then it crashes, no file/directory is shown. Does it happen only to me ? I am launching it directly through Cturt Ps4Playground. File upload through put command works.

@ghost
Copy link
Author

ghost commented Apr 16, 2016

I have found these issues:

  1. The open call (row 315 of ftp.c) always returns a valid handle even when the path does not exists (just try dir command on a non existing directory). If you add a check with the standard fopen call it works perfectly.
  2. The gmtime_r always crashes even though the parameters are good (it can however be skipped to make it work).
  3. The getdents function sometimes crashes (it does not happen always). I have also tried to increase the buffer to 128k, but it didn't solve the issue.
  4. The stat function does not crash, but sometimes it returns a non 0 value hiding therefore some entries (it can however be patched easily)

If someone is experiencing the same issues, I think there might be some problems with the I/O functions of libPS4 of PS4-SDK.

@gibbed
Copy link

gibbed commented Jan 28, 2017

  1. gmtime_r crashes because it doesn't exist in libSceLibcInternal. An alternative exists as gmtime_s. This is an issue with libPS4.
  2. getdents isn't crashing (for me), although using fileno as the condition for the loop is the wrong thing. It's better to check the return of getdents which indicates the size of the data written to dentbuf.
  3. The stat() call fails because getdents returns file names only, the path needs to be built and properly passed to stat().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant