mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
fix(java): check if a version exists when determining GAV by file name for jar files (#5630)
This commit is contained in:
@@ -142,8 +142,8 @@ func (d *DB) SearchBySHA1(sha1 string) (jar.Properties, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *DB) SearchByArtifactID(artifactID string) (string, error) {
|
||||
indexes, err := d.driver.SelectIndexesByArtifactIDAndFileType(artifactID, types.JarType)
|
||||
func (d *DB) SearchByArtifactID(artifactID, version string) (string, error) {
|
||||
indexes, err := d.driver.SelectIndexesByArtifactIDAndFileType(artifactID, version, types.JarType)
|
||||
if err != nil {
|
||||
return "", xerrors.Errorf("select error: %w", err)
|
||||
} else if len(indexes) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user