mirror of
https://github.com/zu1k/nali.git
synced 2025-01-22 21:29:02 +08:00
fix: check wry size before read header
This commit is contained in:
parent
2da7512590
commit
fc9df8dcf0
@ -45,6 +45,10 @@ func NewQQwry(filePath string) (*QQwry, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(fileData) < 8 {
|
||||||
|
log.Fatalln("纯真 IP 库存在错误,请重新下载")
|
||||||
|
}
|
||||||
|
|
||||||
header := fileData[0:8]
|
header := fileData[0:8]
|
||||||
start := binary.LittleEndian.Uint32(header[:4])
|
start := binary.LittleEndian.Uint32(header[:4])
|
||||||
end := binary.LittleEndian.Uint32(header[4:])
|
end := binary.LittleEndian.Uint32(header[4:])
|
||||||
|
@ -39,6 +39,10 @@ func NewZXwry(filePath string) (*ZXwry, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(fileData) < 24 {
|
||||||
|
log.Fatalln("ZX IPv6数据库存在错误,请重新下载")
|
||||||
|
}
|
||||||
|
|
||||||
header := fileData[:24]
|
header := fileData[:24]
|
||||||
offLen := header[6]
|
offLen := header[6]
|
||||||
ipLen := header[7]
|
ipLen := header[7]
|
||||||
|
Loading…
Reference in New Issue
Block a user