fix: harden address parsing edge cases

This commit is contained in:
ZacharyZcR
2026-06-01 04:03:46 +08:00
parent 8ec96bfe6d
commit 569d21a8bc
43 changed files with 273 additions and 137 deletions
+2 -5
View File
@@ -1,9 +1,6 @@
package output
import (
"fmt"
"sync"
)
import "sync"
// ResultBuffer 公共的去重缓冲逻辑,供各Writer复用
type ResultBuffer struct {
@@ -103,7 +100,7 @@ func (b *ResultBuffer) generateKey(result *ScanResult) string {
case TypePort:
if result.Details != nil {
if port, ok := result.Details["port"]; ok {
return fmt.Sprintf("%s:%v", result.Target, port)
return targetWithPort(result.Target, port)
}
}
return result.Target