mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-22 03:10:42 +08:00
fix lint issues before merge
This commit is contained in:
@@ -229,7 +229,7 @@ func (p *ActiveMQPlugin) identifyService(ctx context.Context, info *common.HostI
|
||||
return &ScanResult{
|
||||
Success: false,
|
||||
Service: "activemq",
|
||||
Error: fmt.Errorf("Failed to read response: %w", err),
|
||||
Error: fmt.Errorf("failed to read response: %w", err),
|
||||
}
|
||||
}
|
||||
if n == 0 {
|
||||
|
||||
@@ -169,9 +169,10 @@ var cqlStreamID int16
|
||||
|
||||
func cqlSend(conn net.Conn, opcode byte, body []byte) error {
|
||||
id := cqlStreamID
|
||||
cqlStreamID++
|
||||
if cqlStreamID > 32767 {
|
||||
if cqlStreamID == 32767 {
|
||||
cqlStreamID = 0
|
||||
} else {
|
||||
cqlStreamID++
|
||||
}
|
||||
|
||||
// frame: [1B version|flags] [2B stream] [1B opcode] [4B length] [body]
|
||||
|
||||
@@ -323,7 +323,6 @@ func mssqlParseLoginTokens(payload []byte, result *mssqlRawResult) (bool, error)
|
||||
return false, fmt.Errorf("mssql: truncated done token")
|
||||
}
|
||||
status := binary.LittleEndian.Uint16(payload[pos : pos+2])
|
||||
pos += 12
|
||||
return status&(tdsDoneError|tdsDoneSrvError) == 0, nil
|
||||
default:
|
||||
return false, fmt.Errorf("mssql: unexpected login token 0x%02x", token)
|
||||
|
||||
@@ -341,8 +341,13 @@ func (s *oracleSession) putString(v string) {
|
||||
func (s *oracleSession) putInt(v interface{}, size uint8, bigEndian, compress bool) {
|
||||
num := toInt64(v)
|
||||
if compress {
|
||||
neg := num < 0
|
||||
encoded := uint64(num)
|
||||
if neg {
|
||||
encoded = uint64(-(num + 1)) + 1
|
||||
}
|
||||
temp := make([]byte, 8)
|
||||
binary.BigEndian.PutUint64(temp, uint64(num))
|
||||
binary.BigEndian.PutUint64(temp, encoded)
|
||||
temp = bytes.TrimLeft(temp, "\x00")
|
||||
if size > uint8(len(temp)) {
|
||||
size = uint8(len(temp))
|
||||
@@ -351,8 +356,7 @@ func (s *oracleSession) putInt(v interface{}, size uint8, bigEndian, compress bo
|
||||
s.out.WriteByte(0)
|
||||
return
|
||||
}
|
||||
if num < 0 {
|
||||
num = -num
|
||||
if neg {
|
||||
size |= 0x80
|
||||
}
|
||||
s.out.WriteByte(size)
|
||||
|
||||
Reference in New Issue
Block a user