fix heap overflow with unstable version comparation

fixes #5210
fixes #5251 (the removeDuplicates line)

The issue was mostly with the Version parsing and compring
implementation.
Refactored that based on the https://git.sleeping.town/exa/FlexVer
examples.

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-03-24 20:05:37 +02:00
parent 156b7f365e
commit 5a0931d3cf
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
4 changed files with 175 additions and 226 deletions

View file

@ -1,5 +1,5 @@
# Test vector from:
# https://github.com/unascribed/FlexVer/blob/704e12759b6e59220ff888f8bf2ec15b8f8fd969/test/test_vectors.txt
# https://git.sleeping.town/exa/FlexVer/src/branch/trunk/test/test_vectors.txt
#
# This test file is formatted as "<lefthand> <operator> <righthand>", seperated by the space character
# Implementations should ignore lines starting with "#" and lines that have a length of 0
@ -61,3 +61,10 @@ a1.1.2 < a1.1.2_01
13w02a < c0.3.0_01
0.6.0-1.18.x < 0.9.beta-1.18.x
# removeLeadingZeroes (#17)
0000.0.0 = 0.0.0
0000.00.0 = 0.00.0
0.0.0 = 0.00.0000
# General leading zeroes
1.0.01 = 1.0.1
1.0.0001 = 1.0.01