Bug 410622

Summary: Don't automatically create shortcut when Arguments are malformed
Product: [Frameworks and Libraries] Snoretoast Reporter: Thomas <thomas>
Component: generalAssignee: Hannah von Reth <vonreth>
Status: REPORTED ---    
Severity: normal CC: daniel
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Thomas 2019-08-05 18:19:08 UTC
SUMMARY
When the supplied Snoretoast-Arguments are malformed (because of an error in the supplying app) and the appID therefore can't be obtained, the default shortcut is installed. Also if the -close argument is used without appID, the shortcut is installed. For sure an app shouldn't supply malformed arguments, but developers forget stuff and installing a shortcut is something someone doesn't want to do unintentionaly.

I don't know how to fix this best, but I suggest heavily restricting the cases when a shortcut is created without -install beeing called explicitly or forcing the explicit usage of -install (without arguments) even for usage without an own appID. Also checking the supplied arguments for unknown attributes or unbalanced quotes before installing the shortcut would be great.

STEPS TO REPRODUCE
Some examples:
*) snoretoast.exe -t Hello -m World -b "1;2;3_missing_end_quote -appID "com.example"
*) snoretoast.exe -close -id a //missing appID installs Shortcut

OBSERVED RESULT
A shortcut is installed and in most cases a error-message is thrown.

EXPECTED RESULT
An error-message is thrown and the app exits.