Bug 478453

Summary: Portal makes app crash when an invalid file name is input
Product: [Plasma] xdg-desktop-portal-kde Reporter: pato05mc
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: crash CC: aleixpol, jgrulich, nate
Priority: NOR    
Version First Reported In: 5.27.10   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description pato05mc 2023-12-12 20:22:08 UTC
SUMMARY
I noticed the bug first in Rnote and apparently it affects Telegram as well (and I'm guessing every application that makes use of portals). It is present within the Save file dialog, where inputting a name containing a forward slash in it will make the parent application crash (in the case of Rnote) or hang (in the case of Telegram).


STEPS TO REPRODUCE
1. Open a save file dialog within the targeted application (e.g. Save As option on Rnote)
2. The KDE Portal Save dialog will pop up, just put a name that contains a forward slash character (/) in the middle (like "foo/bar")

OBSERVED RESULT
The application will either crash or hang

EXPECTED RESULT
Either the Save dialog would tell the user that the filename contains an illegal character, or just replace the "/" character with a similar one "⁄" like it happens in Dolphin. 

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Arch Linux (on 6.6.5-zen1-1-zen)
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
Original issue reported in Rnote: https://github.com/flxzt/rnote/issues/926