Skip to content

Commit

Permalink
- Filter out files larger than 4 GiB-1 for the time being.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Mar 21, 2024
1 parent b9a40b9 commit c18926d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cube/swiss/source/devices/fat/deviceHandler-FAT.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ s32 deviceHandler_FAT_readDir(file_handle* ffile, file_handle** dir, u32 type) {
*dir = reallocarray(*dir, num_entries, sizeof(file_handle));
}
memset(&(*dir)[i], 0, sizeof(file_handle));
if(concat_path((*dir)[i].name, ffile->name, entry.fname) < PATHNAME_MAX) {
if(concat_path((*dir)[i].name, ffile->name, entry.fname) < PATHNAME_MAX && entry.fsize <= UINT32_MAX) {
(*dir)[i].size = entry.fsize;
(*dir)[i].fileAttrib = (entry.fattrib & AM_DIR) ? IS_DIR : IS_FILE;
++i;
Expand Down
4 changes: 2 additions & 2 deletions cube/swiss/source/devices/ftp/deviceHandler-FTP.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ s32 deviceHandler_FTP_readDir(file_handle* ffile, file_handle** dir, u32 type){
*dir = reallocarray(*dir, num_entries, sizeof(file_handle));
}
memset(&(*dir)[i], 0, sizeof(file_handle));
if(concat_path((*dir)[i].name, ffile->name, entry->d_name) < PATHNAME_MAX) {
stat((*dir)[i].name, &fstat);
if(concat_path((*dir)[i].name, ffile->name, entry->d_name) < PATHNAME_MAX
&& !stat((*dir)[i].name, &fstat) && fstat.st_size <= UINT32_MAX) {
(*dir)[i].size = fstat.st_size;
(*dir)[i].fileAttrib = S_ISDIR(fstat.st_mode) ? IS_DIR : IS_FILE;
++i;
Expand Down
4 changes: 2 additions & 2 deletions cube/swiss/source/devices/smb/deviceHandler-SMB.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ s32 deviceHandler_SMB_readDir(file_handle* ffile, file_handle** dir, u32 type){
*dir = reallocarray(*dir, num_entries, sizeof(file_handle));
}
memset(&(*dir)[i], 0, sizeof(file_handle));
if(concat_path((*dir)[i].name, ffile->name, entry->d_name) < PATHNAME_MAX) {
stat((*dir)[i].name, &fstat);
if(concat_path((*dir)[i].name, ffile->name, entry->d_name) < PATHNAME_MAX
&& !stat((*dir)[i].name, &fstat) && fstat.st_size <= UINT32_MAX) {
(*dir)[i].size = fstat.st_size;
(*dir)[i].fileAttrib = S_ISDIR(fstat.st_mode) ? IS_DIR : IS_FILE;
++i;
Expand Down

0 comments on commit c18926d

Please sign in to comment.