Skip to content

Version check does not validate input #71

@ashfire908

Description

@ashfire908

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 -----------```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions