-
Notifications
You must be signed in to change notification settings - Fork 506
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
fix: version compare can't handle ~ in version numbers #3558
Comments
This one's interesting: even once we fix the ~ problem, it's still not going to know how to compare deb9u2. Is this pattern common enough that we should build this pattern into the version checker, or truncate it as I'm suggesting we do with the un-comparable hashes? This definitely looks more like something we could actually compare, but it's not clear to me if doing so makes things better or worse. |
Also, now that I'm seeing some data (thank you so much for these bug reports!) it seems like it's probably worth going from individual character substitutions to something more like s = re.sub('[^0-9a-zA-Z]+', '.', s) And just subbing in anything that isn't alphanumeric. Need to do a bit of thinking or data crunching as to whether we need to support unicode here and have a slightly better regex to handle that, though. |
I did some additional asking around and consensus is that ignoring the distro part is probably good enough as a first step. There's room for more finesse to use this data, and we might want to point people at the available_fix tools https://github.com/intel/cve-bin-tool/tree/main/cve_bin_tool/available_fix for some triage help. But for now I'm happy if the fix for #3556 handles the deb* part by truncating it. |
This switches the logic so we treat all non-alphanumeric characters as separators equivalent to `.` in version strings. This should make the code more robust to unusual version strings. * Fixes intel#3558 (in that we will be able to handle `~`) Signed-off-by: Terri Oda <terri@toybox.ca>
This switches the logic so we treat all non-alphanumeric characters as separators equivalent to `.` in version strings. This should make the code more robust to unusual version strings. * Fixes intel#3558 (in that we will be able to handle `~`) Signed-off-by: Terri Oda <terri@toybox.ca>
This switches the logic so we treat all non-alphanumeric characters as separators equivalent to `.` in version strings. This should make the code more robust to unusual version strings. * Fixes #3558 (in that we will be able to handle `~`) Signed-off-by: Terri Oda <terri.oda@intel.com>
very similar to #3552
happens with https://storage.googleapis.com/debian-osv/dla-osv/DLA-3008-1.json
The text was updated successfully, but these errors were encountered: