Harden scan robustness and tests

This commit is contained in:
ZacharyZcR
2026-06-14 22:23:48 +08:00
parent 5ad914a1bb
commit c49c23c7f0
100 changed files with 4483 additions and 412 deletions
+1 -4
View File
@@ -244,10 +244,7 @@ func parseSNMPResponse(data []byte) string {
if value.Tag == asn1.TagOctetString || value.Tag == asn1.TagUTF8String {
s := strings.TrimSpace(string(value.Bytes))
if len(s) > 200 {
s = s[:200]
}
return s
return truncateRunes(s, 200)
}
return fmt.Sprintf("(type=%d, len=%d)", value.Tag, len(value.Bytes))
}