Current behavior
mullvad_version::Version::from_str accepts a valid version when it is preceded by invalid
characters. For example, prefix2025.1 is parsed as 2025.1.
This is also observable through the version utility:
$ ANDROID_VERSION=2025.1 cargo run -q -p mullvad-version --bin mullvad-version -- versionCode
25019000
$ ANDROID_VERSION=prefix2025.1 cargo run -q -p mullvad-version --bin mullvad-version -- versionCode
25019000
Expected behavior
Version strings should only be accepted when the entire input matches the Mullvad version format.
prefix2025.1 should return a parsing error.
Cause
VERSION_REGEX is anchored at the end with $, but is not anchored at the start. Git history
shows that the previous parser used a leading ^.
I searched the existing issues and pull requests for similar reports before filing this issue.
Current behavior
mullvad_version::Version::from_straccepts a valid version when it is preceded by invalidcharacters. For example,
prefix2025.1is parsed as2025.1.This is also observable through the version utility:
Expected behavior
Version strings should only be accepted when the entire input matches the Mullvad version format.
prefix2025.1should return a parsing error.Cause
VERSION_REGEXis anchored at the end with$, but is not anchored at the start. Git historyshows that the previous parser used a leading
^.I searched the existing issues and pull requests for similar reports before filing this issue.