joel16 / NX-Shell

A multi-purpose file manager for the Nintendo Switch.
GNU General Public License v2.0
960 stars 66 forks source link

Selecitng multiple files with long file names crashes the whole console #37

Closed Blazingflare closed 5 years ago

Blazingflare commented 5 years ago

When attempting to select multiple files for copying or deleting, if a file has a sufficiently long file name (around 80+ characters) when it is selected, the Switch will crash with an error or totally freeze requiring the power button to be held for 7 seconds. Copying or deleting the files by themselves works just fine. It's only when they are multi selected that it crashes.

joel16 commented 5 years ago

Can you enable developer options in the settings menu and check if a log file is generated in /switch/NX-Shell/debug.log?

Blazingflare commented 5 years ago

I just checked after making it crash again while developer options was on. It didn't generate a log.

joel16 commented 5 years ago

Weird, could you give me their names as an example? I'll try them on my own device and debug it further when I get time.

Blazingflare commented 5 years ago

Sure.

Copy of [DLC] South Park(tm) The Fractured But Whole(tm) Relics of Zaron - Stick of Truth Costumes and Perks Pack [DLC][01008f2005155001][v0].nsp The actual file itself was only about 100KB. This file name also instantly crashed my Switch when I multi selected it, even if it was the only file I selected. When I trimmed the file name down to around 40 or so characters by removing some of the English characters. It stopped crashing.

fennectech commented 5 years ago

Screams of buffer overflow to me.

hacheraw commented 5 years ago

Same here with ReiNX at 6.2 At first, I was selecting all of them in order:

'Super Smash Bros Ultimate [01006A800016E000][US][v0][SoftCobra.com].nsp'
'Super Smash Bros Ultimate [01006A800016E800][v131072].nsp'
'Super Smash Bros Ultimate [Challenger Pack 1] [01006A800016F002][v0].nsp'
'Super Smash Bros Ultimate [Challenger Pack 2] [01006A800016F003][v0].nsp'
'Super Smash Bros Ultimate [Challenger Pack 3] [01006A800016F004][v0].nsp'
'Super Smash Bros Ultimate [Challenger Pack 4] [01006A800016F005][v0].nsp'
'Super Smash Bros Ultimate [Challenger Pack 5] [01006A800016F006][v0].nsp'
'Super Smash Bros Ultimate [Limited Time Offer Piranha Plant] [01006A800016F001][v0].nsp'
'Super Smash Bros Ultimate [Super Smash Bros Ultimate Fighters Pass Bonus Mii Fighter Costume Rex] [01006A800016F015][v0].nsp'

It crashed several times when selecting the last one. Then, I decided to select only three. Again, wwhen selecting the last one it crashed. Also hapened when selecting the last one alone.

All of them are 120KB in size.

joel16 commented 5 years ago

Fixed with https://github.com/joel16/NX-Shell/commit/04ba97fb4fafe9c36a93135b496aa1754782b4e8

Use the latest nightly if you wish.