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

Version check does not validate input #71

Open
ashfire908 opened this issue Jul 12, 2012 · 1 comment
Open

Version check does not validate input #71

ashfire908 opened this issue Jul 12, 2012 · 1 comment

Comments

@ashfire908
Copy link

The version check does not verify the returned page is actually a valid version before attempting to parse it. If something other than a version is returned (say, a HTML page, displayed by either a router, proxy, or an error screen by the server), MultiMC crashes.

Error report for 7/7/2012 2:31:07 PM

Exception type: System.ArgumentException
MultiMC Version: 3.1.2.0

Computer info:
    Operating System: Windows
    Runtime: DotNet

---------- BEGIN STACK TRACE ----------
System.ArgumentException: Version string portion was too short or too long.
   at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
   at System.Version.TryParseVersion(String version, VersionResult& result)
   at System.Version.Parse(String input)
   at System.Version..ctor(String version)
   at MultiMC.Tasks.Updater.GetLatestVersion()
   at MultiMC.Tasks.Updater.CheckUpdate()
   at MultiMC.Tasks.Updater.TaskStart()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
----------- END STACK TRACE -----------```
@ashfire908
Copy link
Author

I went back emulated the issue in VS. The error is triggered on line 100 of MultiMC/Tasks/Updater.cs. Some simple error checking there (maybe just a try/catch for ArgumentException) should do the job.

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

No branches or pull requests

1 participant