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 using a reserved path character in a profile name. #237

Closed
ThomasEnglish opened this issue Dec 16, 2016 · 2 comments
Closed

Crash when using a reserved path character in a profile name. #237

ThomasEnglish opened this issue Dec 16, 2016 · 2 comments
Labels

Comments

@ThomasEnglish
Copy link

I was creating a profile for CSGO, and I gave it the name "CS:GO Profile". This caused Artemis to crash.
It looks like this could be related to Windows file naming restrictions:

`Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:

  • The following reserved characters:
    • < (less than)
    • > (greater than)
    • : (colon)
    • " (double quote)
    • / (forward slash)
    • \ (backslash)
    • | (vertical bar or pipe)
    • ? (question mark)
    • * (asterisk)
  • Integer value zero, sometimes referred to as the ASCII NUL character.
  • Characters whose integer representations are in the range from 1 through 31, except for alternate data streams where these characters are allowed. For more information about file streams, see File Streams.
  • Any other character that the target file system does not allow.`

Source: https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247(v=vs.85).aspx

Bug:
The program crashes when including a colon character in a profile name.

Reproduction:
Include a colon in a profile name when creating or duplicating a new profile.

Crash Report:

An unexpected error occurred in Artemis.

Illegal characters in path.
____________________________________________________
System.ArgumentException

Message:
Illegal characters in path.

Stack Trace:
   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   at System.IO.Path.GetFileName(String path)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
   at Artemis.DAL.ProfileProvider.AddOrUpdate(ProfileModel prof)
   at Artemis.ViewModels.Profiles.ProfileEditorViewModel.<DuplicateProfile>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

TargetSite:
Void CheckInvalidPathChars(System.String, Boolean)

Source:
mscorlib

HResult:
-2147024809
@RobertBeekman
Copy link
Member

Hey, thanks for the report and the extra info, I'll adjust the file names to exclude these symbols before saving in the next update

@RobertBeekman
Copy link
Member

Hey, didn't get around to doing this in 1.7 but I wanted to push that update due to the fact that I won't have much time next week. I'll get on it asap though.

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

No branches or pull requests

2 participants