Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions e2etests/grpc_full_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ func checkGRPCMatch(t *testing.T, expectedVuln, matchingVuln *v1.Vulnerability)
}
expectedVuln.MetadataV2 = nil
matchingVuln.MetadataV2 = nil

expectedVuln.Description = normalizeString(expectedVuln.Description)
matchingVuln.Description = normalizeString(matchingVuln.Description)

assert.Equal(t, expectedVuln, matchingVuln)
}

Expand Down
10 changes: 10 additions & 0 deletions e2etests/sanity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/json"
"fmt"
"sort"
"strings"
"testing"

v1 "github.com/stackrox/scanner/api/v1"
Expand Down Expand Up @@ -58,6 +59,10 @@ func checkMatch(t *testing.T, source string, expectedVuln, matchingVuln v1.Vulne
}
expectedVuln.Metadata = nil
matchingVuln.Metadata = nil

expectedVuln.Description = normalizeString(expectedVuln.Description)
matchingVuln.Description = normalizeString(matchingVuln.Description)

assert.Equal(t, expectedVuln, matchingVuln)
}

Expand Down Expand Up @@ -183,3 +188,8 @@ func deepGet(m map[string]interface{}, keys ...string) interface{} {
}
return currVal
}

// normalizeString removes newlines and collapses multiple spaces into one.
func normalizeString(s string) string {
return strings.Join(strings.Fields(s), " ")
}
2 changes: 1 addition & 1 deletion e2etests/testcase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ var testCases = []testCase{
{
Name: "CVE-2018-1125",
NamespaceName: "centos:7",
Description: "DOCUMENTATION: If a process inspected by pgrep has an argument longer than INT_MAX bytes, \"int bytes\" could wrap around back to a large positive int (rather than approaching zero), leading to a stack buffer overflow via strncat(). MITIGATION: The procps suite on Red Hat Enterprise Linux is built with FORTIFY, which limits the impact of this stack overflow (and others like it) to a crash.",
Description: "DOCUMENTATION: If a process inspected by pgrep has an argument longer than INT_MAX bytes, \"int bytes\" could wrap around back to a large positive int (rather than approaching zero), leading to a stack buffer overflow via strncat(). MITIGATION: The procps suite on Red Hat Enterprise Linux is built with FORTIFY, which limits the impact of this stack overflow (and others like it) to a crash.",
Link: "https://access.redhat.com/security/cve/CVE-2018-1125",
Severity: "Low",
Metadata: map[string]interface{}{
Expand Down