anchore / grype

A vulnerability scanner for container images and filesystems
Apache License 2.0
8.15k stars 528 forks source link

fix match sort ordering for different locations #1944

Closed luhring closed 2 weeks ago

luhring commented 2 weeks ago

A common case in vulnerability matching is when two vulnerability matches are the same except for their location. I noticed this case was causing Grype to produce inconsistent output when using its match sorting, e.g. sort.Sort(match.ByElements(matches)).

This PR adds consideration for locations into the match sort ordering logic.